I think when it comes to what constitutes as a Mary Sue, it should be something like a flawless audience surrogate in theory and to some extent, in practise too. However it’s also used to deride characters some readers dislike such as Carol Danvers. I actually/honestly don’t think Carol Danvers is really much of a Mary Sue. If she’s going to go bad but the fact that Mary Sues are supposed to be flawless, then technically Carol isn’t.
I don’t think Carol Danvers is ever created as an audience surrogate, which most fanfic Mary Sues tend to be, so she’s disqualified either way. I actually think the characters most in danger of becoming Mary Sues aren’t competent female characters (or even competent male characters or whatever) but rather audience surrogate characters.
(Author surrogates usually don’t much either but because it’s usual to depict stories and literature after authors’ own sentiments and experiences to whatever degree.)
Especially in things most aimed at nerds that there’s a good chance an audience surrogate would easily become a Mary Sue. Barry Allen’s something of a borderline Mary Sue in my definition. Not because he’s flawless but because he’s created to be an idealised audience surrogate even if it robs him of a personality beyond that.
(Not that he lacks a personality but because he lacks any personality beyond that role as I meant.)
There were some attempts to de-Sue him even if it’s met with resistance (I was part of that too). An even more egregious Mary Sue would be Tim Drake. It’s not that he’s flawless but rather almost all the characters around him are sometimes depicted as so flawed as to keep him on a pedestal. (Especially Stephanie Brown but I have a feeling it might not last if she does become a Red Lantern because Tim killed her pet.)
Perhaps a much more blatant one (especially if it’s almost dangerously close to one’s parody and initial identification) would be Kitty Pryde. Although she wasn’t initially conceived as such and some non-comics media do downplay this, but as what one blogger noted, she seems to pander very much to a narrow audience that to outsiders she’s definitely not a girl next door.
For starters, a lot of comics characters own dogs because lots of people own dogs. But the same can’t said of her, she owns a dragon on top of being a mutant hacker-martial artist who’s part of a franchise that’s largely and practically insulated from the rest of the Marvel universe. So much so that it proves her point right. Another one would be Felicity Smoak.
Of all the characters, for the longest period of time (in comics) she wasn’t created as an audience surrogate and was even somebody’s mum! By the time she appeared on Arrow, she was made entirely different from her comics counterpart that she’s barely recognisable. Some fans liked her so much that they demanded writers to increase her presence and make her romance with Oliver canon.
But it also bothered other fans that I think it’s more of a case where fans better be careful of what they wish for. Especially if Felicity Smoak turned out to be a victim of her own popularity. I still think when it comes to Canon Sues, the more they’re made in mind for a specific audience the likelier they are to be identified a lot to the detriment of gaining a proper personality.
Or in Kitty Pryde’s case, go where she’d logically become (something like in Age of Apocalypse). Though Mary Sues can be author surrogates, not all author surrogates are necessarily Mary Sues as it’s not uncommon for writers to base prose and stories after themselves and people they personally know to varying degrees. Of all the characters considered Mary Sue, only four qualify and come dangerously close to the fanfic Mary Sue.
As in they’re fan-surrogate characters stuck in a world that’s in the same setting as the franchise said fan likes. Felicity Smoak being a very damning example as she’s part of a franchise she wasn’t historically part of. (It would be more plausible with Tim Drake, that’s had Black Canary been outed as his biological aunt as she’s part of Birds of Prey and Justice League, which has Batman family members in both.)
Likewise Kitty, Tim and Barry are conceived as audience surrogate heroes in pre-existing franchises. Two of them are fans of pre-existing characters and one gets to be part of a pre-existing group permanently. Likewise Tim got adopted by Batman. These come dangerously close to the fanfiction Mary Sue where they’re adopted and/or tormented by tragedy.
None of these exactly mean a Mary Sue as much as I think these are half-arsed attempts at making them fallible. Not that Mary Sues can’t be flawed and some of them have flaws with consequences. But rather a better marker of Mary Sue to me would be the inability to go where the character would logically become. But that would involve having to let the character do what they need to do or become.
And on a closing note, I suspect if you were to make a character any less of a Mary Sue don’t make them too idealised.