Part One: It's Not As Bad As You Think
Any writer who has opened their work to criticism or posted their work on the Internet (oh wait, that's the same thing), has undoubtedly heard the term "Mary Sue." In all likelihood, you've heard this term because one of your characters has had this label thrown at them. Perhaps the fear alone of having your character turned into a dartboard for flamers has driven you to discover the definition of this term. In fact, it's likely that the fear of this label has altered your writing and characterization in some way. Has it driven you to be less shallow, and make your characters less shallow? Good! Has it driven you to think more carefully about your plot devices to make sure you're not pulling a Deus Ex Machina, and to keep a close eye on your characterization to make sure you're not derailing any of their personalities? Good! Has it driven you to become so obsessed with every minute detail, you've forgotten that you cannot please everyone and you stopped having fun with the writing? Not so good.
The problem with the "Mary Sue" label is that people have forgotten what it actually means, and so they are throwing it around like the mot du jour without having any idea what they are actually saying. Do you know that the saying "It's a Doozy" once referred to something being so So Cool It's Awesome, and not something to watch out for? Do you know which profession sparked the phrase "show me the ropes"? Same goes for Mary Sue: People have started sticking the label on any character they don't like, and it has skewed the definition to a point where it's so highly subjective, its original meaning is all but lost. As unnerving as Sue sometimes may be, she is nothing to stay up nights fretting about, because the people who throw the label at you will often have no idea what they're actually accusing you of... and likewise, you may not know what you're being accused of either. The best you can do is to be informed, and not have a Giant Royal Flipout until you know exactly what to look out for in your characters.
According to TV Tropes, the abbreviated definition of Mary Sue is:
...a character who obviously serves the purpose of wish fulfillment for the author -- not merely as a true to life author insertion, but as an overly idealized version of the author. She is head-turningly beautiful, with hair and eyes of colors not natural for the story's norms, and she has a similarly cool and exotic name. She's exceptionally talented in an implausible variety of areas, and possesses skills that are rare or nonexistent in the established setting. Regardless of what skill levels the other characters have established, she is simply better than them, often in ways that do not make sense. If she needs to know a plot-relevant skill, she'll pick it up in a fraction of the time required, if she doesn't magically know it already. She also lacks any significant, story-relevant character flaws -- either that, or her "flaws" are obviously meant to be endearing. She is highly persuasive, regardless of how easy it normally is to convince the other characters of anything. She is incorruptible. In fact, she is often unaware of the existence of temptation. Her personality is practically nonexistent; she is either unabashed and cheerful, mopey and depressed beyond necessity, or violently explosively angry (almost always in a justified vengeful rampage).
In summary, "Mary Sue" is a term given to a character who is vital to the story, possesses highly unusual physical traits, attracts the attention of the other characters to a story-altering degree, and has an over-idealized and irrelevantly over-skilled nature. However, therein lies the problem this term is generally slapped onto ANY character possessing any number of these traits, without regarding how many of these traits the character exhibits, why those traits are there, or how realistic they are. With the way the term has mutated over time, a great many people just end up labeling any character overdosed with these traits as a Mary Sue.
This is not necessarily true.
Even if a character has quite a number of the traits described, creating a Sue can still be averted by a good enough explanation for why these traits are there. In fact, there are many real-life people who have taken the "Mary-Sue Litmus Test" and failed. Tom Petty achieves a score of "Kill It Dead." Does this mean that these people -- who are here, in real life, and therefore are obviously real -- are unrealistic? Is Tom Petty a walking cartoon?
See, Mary Sue is not completely about how she has radiant purple hair, a perfect seven octave singing voice, and can slice Superman with her katana -- although that does make a difference, if these traits aren't given plausible explanations and balanced out with flaws of equal gravity. It's about what she does to the story. There's a fine line between a character with traits that make her really stand out, and a Mary Sue. It's only partially defined by her appearance, her abilities, or how fantastically improbable her backstory is. Moreover, it is about how the character is defined exclusively by external traits to the point of shallowness, and about how all the other characters are defined exclusively by their attitude to her. Looks aren't the half of it. It is other qualities -- abilities, personality (or lack thereof), and the way that not just the story, but the entire WORLD revolves around a character, even though it logically wouldn't -- that make a character a Sue.
The current craze to avoid Typhoid Mary Sue is causing good writers to go to the extreme of creating characters with absolutely no points of interest, falsely believing that any stand-out qualities will make their character a Sue. As we've just noticed, the ability to stick your character into the mold does not mean that they belong there. Allow me, for a moment, to point out the obvious: You must have an interesting character. You cannot have a completely normal character with no physical qualities, personality traits, past events, mannerisms, abilities, or some sort of quirk, that make him/her stand out in some way. If your character is just your standard Joe Shmoe and has no points of interest, then you have hit a rather big "duh" of a roadblock -- your character is not interesting. If your character is not interesting, nobody is going to read your story. Do YOU read stories where the characters don't draw you in? Even the most action-packed, twisted-plot, blow-your-mind-and-leave-you-drooling-like-a-tard book can be killed dead by a boring-ass main character. I couldn't get past chapter 5 of Catcher in the Rye because Caulfield was so irritatingly dull.
Now, if you are so utterly obsessed with the "MY CHARACTER CANNOT BE AMAZING" fad that you literally cannot add any embellishments to him/her, do bear in mind that characters can be cursed with normal. What if your story exists in a universe where everyone can read minds, and your protagonist, for whatever reason, can't? What if your character is the odd man out by being the only one without superpowers? Your character can also be made different simply by having a different mindset than everybody else. Look at Horton Hears a Who! It's all about being willing to get creative with something, while not going over the edge of believability.
However, READ THIS AND ABSORB: I am not encouraging you to make shallow, over-the-top unusual, borderline-unbelievable characters just because you can, because guess what? Mary Sue. That "edge of believability" is very important, and cannot be forgotten. I am not encouraging you to stop taking caution entirely. I'm just saying you don't need to be so paranoid that the sheer unadulterated terror makes ink shoot out of your ears. You can have characters who are odd, who don't fit in, who stand out above the rest. You simply have to have valid, well-plotted, not-handwaved-away explanations for these traits, and flaws that balance them out.
The important thing as a writer is not to never have this label thrown at you, even once in your life... because it will happen. People throw the word around all the time without a thought toward the context. The important thing is to make your characters believable. Not completely normal, not without any fantastical or above-normal qualities, just believable. You can always provide perfectly good explanations as to why a character has traits that make them stand out. The main thing is to realize that the label doesn't matter. What matters is that you have the confidence to stop worrying about what people are calling your character, and worry more about improving your talent so that you have something worthwhile to bring to the table.