And now...
You are convinced that the Mary Sue trope hurts female protagonists and society in general.
You are convinced that "perfect" is a terrible idea for how to portray yourself in your book.
Great news:
I can help you avoid the Mary Sue trope trap.
Consider a well-written heroine mentioned earlier.
Princess Leia holds the moral high ground while menacing Darth towers over her.
She'll do anything to protect her people.
And yet she falls for the bad boy even though she knows she shouldn't.
That's . . . a real woman.