I was asked and interview question that brought this character to mind, but I've thought about her a lot. The interviewer asked me how I avoid writing a Mary Sue character. I told her I'm not sure that I do, because that's the truth. Sometimes she sneaks in...whether we realize it or not.
Mary Sue a literary term named after an actual character that appeared in some 70s-era Star Trek fan fiction. I'm a huge fan of all pre-JJ Abrams Trek, so I have no problem with sweet little Mary Sue. In the original story, she was a very young and yet amazingly adept officer who had adventures in which she invariably saved the day. Now, a certain type of character is known as a Mary Sue, and she's not always female. Many have likened another Star Trek character, Wesley Crusher, to a Mary Sue.
Generally speaking, a Mary Sue character is there in place of the author. She's quite normal or very young, yet somehow has amassed an amazing amount of skills that allow her to come up with solutions to problems in the nick of time. She is well-liked by others, particularly her superiors, and becomes integral to the plot. She rarely, if ever, does anything wrong and she usually doesn't fail.
It's a broad definition, and that's because the term is very broadly applied. Mary Sue has many variations, including Marty Stu and Einstein Sue. The term is so widely used, in fact, that many authors are terrified of adding a Mary Sue to their stories. Critics will verbally lambast writers whom they believe have created this type of character.
But I think Mary Sue is actually in every story, and I'm going to tell you why. At its broadest, the term applies to a character the represents the author. I propose that all main characters represent their authors, at least in part. How else could the author create the three-dimensional main character that feels real to the audience?
So don't be afraid of creating a Mary Sue. Embrace it instead. Don't ever write for critics, or for fear of them. Write for yourself...and then Mary's going to end up sneaking in anyway, so go ahead and welcome her.