Not 'who' ... 'what'.
A Mary Sue is an idealized and seemingly perfect fictional character. Often, this character is recognized as an author insert or wish fulfillment. They can usually perform better at tasks than should be possible given the amount of training or experience, and usually are able through some means to upstage the main protagonist of the story, such as by saving the hero. A male can also be referred to as a Marty Stu, Larry Stu, or Gary Stu, but Mary Sue is used more commonly.
In fanfic, for instance, a 'Mary Sue' will beam aboard the Enterprise, stave off the Romulan attack, repair the ship's engines, perform brain surgery on the captain, reprogram the ship's computer, and lay in a new course for Risa, the Pleasure Planet, where she will very graphically seduce a fallen god while composing a Klingon opera and beating a Zakdorn master at Strategema and Data at three-dimensional chess.