This is kind of what a Gary Stu looks like in HP cannon. If you want examples from other media look at Tek Jansen, Master Chief, and even the overly geeky Wesley Crusher.
Gary Stu watched amusedly as Voldemort attempted to hit him with killing curses. None came close. Gary Stu finally got bored and the author tried to show how he had some sort of fear, but just ended up shooting Voldemort. Then in a move no one saw coming the author hinted that the horocruxes he had conveniently not given Gary knowledge of may be used to create a sequel. As everyone around Gary cheered, Voldemort sat up. Gary's gun "conveniently" ran out of ammo and Voldemort apparated away because he is just that much of a coward.
Dumbledore shook his head in the afterlife and had a feeling he had forgotten to tell the exchange student who was now doing Harry's job for no reason something important. Something about how love and compassion were Voldemort's weaknesses. Oh well chances are Gary had already shot Voldemort the required seven times in the head to destroy all his horocruxes without hunting for them. Because his whole life had revolved around manipulating others and feeling no compassion whatsoever, Dumbledore didn't think it was important. "Look at it this way, fighting dark lords a three year old could have stopped somehow builds character." Dumbledore said to no one in particular as he was alone.
Gary Stu checked the homing beacon he had placed on Voldemort on a laptop that somehow worked in a magically saturated area (A/N yes I will have a reason the laptop worked in International Police). Then he telephoned the president who then ordered a nuclear strike on the dark lord, and no one noticed the mushroom cloud, the radioactive fallout, the fact that several miles of land were blown to bits, and that any nation would consider a nuclear strike anywhere in the world oddly suspicious (but the author didn't care really because the author doesn't even know there was country other than the one he lives in). Everyone lived as happy super powered mutants that could never be created by nuclear radiation the end. Oh and somewhere along the way Gary got laid and killed Draco and everyone was even happier. Except his sister Mary Sue who loved the hot blond anorexic Nazi who would rather kill her than look at the mudblood's face, but soon forgot all about it when she realized she could now be with Harry twenty four seven. And Ginny was nowhere to be found as she had been last seen with Gary, Luna, Hermione, Cho, Pansy, McGonagall, and Fleur heading to a very large closet.
Ok oversimplification but true none the less. Well except for the nuke part and McGonagall, I made that up.
Signed the good dr.