One thing you've got to remember as a writer is that you are not, in any spiritual sense, getting "inside people's heads". What you are doing is producing an artefact that convinces other people that you are inside the minds of many different characters but only as long as they don't look too terribly hard. Your question poses a worry that you can see that all your characters are just variations on you, or that you are having some difficulty drawing the line between where you end and your characters begin.
Much apart from anything else, this is a problem of things not being realistic enough. After all, there is only one you and all the people who aren't you are someone else. Therefore any exercise in writing that does not feature you as a character must feature loads of people who are not at all like you and none that are. If you produce a work which has many variations on you and no one that is not you that's a problem, right?
Well, no, not as such. You don't have a choice about lending some aspect of you to every character you write - after all, you're writing them. As I said when we looked at this problem at first glance the problem is not actually writing characters who are not you. It is making other people happy that all the characters are not you and most importantly letting you know all your characters are not you.
The closest experimental parallel I can think of is with the experience of the actor. I was interested in acting for many years and, when taking on a part, I used to try my best to get under the skin of the character. Contrast this mental experience with the advice of most acting theorists; the most famous, Stanislavski, talks in no uncertain terms about the difference between acting something and being it.
To Stanislavski, experience of reality is a completely separate thing from acting out that experience for an audience. He talks about the essential property of emotional distance from the character you are acting. The character may be overwrought, therefore the actor must act out overwrought but the actor must not be overwrought because that is just self-indulgence. The actor's duty is to communicate the experience to the audience so they can be moved by it, the actor must try not to be.
Stanislavski's point of view has been argued about but I think there is much of merit in it. I knew many young actors (at one point I was among them) who spent enormous amounts of time psychoanalysing the character who subsequently turned in a performance that a 2'x4' would have been proud of.
Another of Stanislavski's lessons which is pertinent here is called the "magic if". Essentially the characters in plays have families which are not like the actor's, they experience circumstances and have histories which are not like the actor's. In order to "get into character" Stanislavski positively encourages actors to ask how it is they would feel in the exact same circumstances, so "what if my uncle had murdered my father and married my mother, how would I tackle this situation?".
The purpose of this exercise is to measure ways in which you, as a person, are similar to the character you are playing and how you are not the same at all. Essentially your sense of difference from the character as an actor helps you know how to portray them without getting confused and being them. The actor who identifies too closely with his role is a subject of dark, horrific melodrama for good reason. It's not pleasant to feel too close to your subject matter.
So as a writer where does this leave us?
- Don't panic about your characters sharing aspects of you, this is inevitable.
- Your writing, like an actor's acting, performs the job of representing a world of rich and distinct personality, not actually being one.
- The problem here seems to be of gaining some distance and perspective from the characters you create.
3 is the troublesome one. I would suggest two things:
- Write a story in which you are a character. Nothing acts a distancing mechanism better than consciously trying to do something you're afraid you're doing by accident. (HINT: I expect you'll find it hideously difficult.)
- Write about a few characters who do things that you most certainly wouldn't do and work out what motives they could have had for doing them. Comb through their motivations because characters are made from such things.
Hopefully these two exercises should start giving you the distance that you need.