Tom Bombadil in The Lord of the Rings. As noted under Beware the Silly Ones, he's lively, dresses in colorful clothes, loves to sing and is a total Cloudcuckoolander who's older than most, if not all, of the other characters and is speculated to be able to resist Sauron at the height of his power for a while, at least. Oh, and the One Ring has absolutely no effect on him, other than giving him a slight bad feeling. He qualifies for this trope because it's speculated that at least part of the reason the Ring doesn't effect him is because he's too absent-minded to notice or worry about it.
While she may have been only five years old, Literature Junie B Jones showed some early signs of this. Among other things, she brought a fish stick to school for pet day, and her teacher actually agreed that it was legit.
Dirk Gently. There aren't many people who, when they read about an accident being ruled an act of god, take the time and energy to correctly identify which god did it. (It was Thor.) There are fewer still who would then take their insurance agency to task over it, pointing out that an "act of god" in the constitutionally protestant UK must legally refer to the Christian god. Since his house was destroyed by Thor, Dirk insists that the insurance company has to pay out.
Though Dirk certainly qualifies, you can't help but wonder how you thought of him while skipping over Ford Prefect.
Ford, you're turning into a penguin. Stop it.
Ford Prefect. Smuggled himself and two friends onto a very public spacecraft by pretending to be a very important scientist and that two boxes filled with videocassettes of movies were his equipment, defrauded a massive corporation whilst on the run from security and then escaping by throwing himself out a windowtwice, and tried to buy a spaceship off of "The King" (Elvis Presley) and then was given it for free. And all that's just the tip of the iceberg.
Zaphod. Beeblebrox. Became President of the Galaxy for shits and giggles — and that's the most mundane thing he's done.
To get deeper into it—he invented a drink that's so strong that one sip is enough to warrant rehab, hijacked one of the most advanced spaceships ever made, found a long-lost, faded-into-myth planet, uncovered a massive government conspiracy, and (if you think And Another Thing... to be canon) made a chain of deals that unwittingly resulted in saving the human race.
Mad-Eye Moody. CONSTANT VIGILANCE! That was really Barty Crouch Jr. But then, since he had milked the real Moody of every single eccentric quality and was going out of his way to act like him, it may count.
Bloody Stupid Johnson from Discworld. His Organ in the UU, to wit: "One foot kicked the 'Afterburner' lever and the other spun the valve of the nitrous oxide cylinder."
He built ornamental fountains that can be used as artillery pieces and managed to invent a simple mail sorting machine that ripped a hole in time. Doing so because he needed a way to change pi to 3. Because "three and a bit" is untidy.
Later, he decided that he wasn't dead...so he wasn't. The Valkyries tried to take him to Valhalla, but instead he mugged them and rode their flying horses of into the stars to look for a space fantasy setting so that he could keep on barbarianing.
Sir Samuel Vimes in The Fifth Elephant, where he kills two werewolves with his bare hands after going over a waterfall. He's had plenty of other moments too.
Don Quixote thinks he's a knight. And fights windmills. He thought they were giants.
This proves to be to our benefit when we are later attacked by sentient windmill-monsters. Who could save us?.
"The moment their arms spun freely in our air, they were doomed — for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane."
Great Uncle Ebbitt from The Seventh Tower definitely comes under this. Not only is he willing to attempt feats of magic and crazy stunts that even Milla would think twice about and has the competence to pull them off, he actively enjoys them. He doesn't just play the trope but actively enjoys it. It's half lampshaded, half a plot point later on in the book.
Nakor the Blue Rider, from The Riftwar Cycle. He refuses to acknowledge the existence of magic, despite being one of the world's most dangerous magic users, and his brand of magic follows no discernible rules or limits. He once defeated a Big Bad (who was his ex-wife) by throwing pepper at her and then hitting her with a sack of oranges while she was sneezing. The aforementioned sack of oranges contains an interdimensional rift in space-time leading to a fruit vendor, which Nakor created because he was hungry. He slept with an Artifact of Doom under his pillow for decades, robbing him of his dreams, and in retrospect realized this might have caused his insanity.
Second Apocalypse: Cnauir urs Skiotha is quite literally crazy, as he is consumed with guilt over having been manipulated by Moenghus thirty years ago. However, this obsessive guilt also drove him to become the "most violent of men". He is amazingly skilled in combat (being the only character to land a blow on Kellhus in single combat), a very insightful tactician, and is so horrifying in battle his enemies see him as an avatar of their own god of war.
Heinrich Von Kleist gave us this unforgettable moment in his short story The Earthquake in Chile, written in the late 1700s: "Don Fernando, that godly hero, now stood with his back up against the church, clutching the children with his left hand and the sword with his right." Just for reference, "the children" refer to two infants, and the sword he was fighting with was fighting off a mob of men who had lost their families in the earthquake who blamed it completely on Fernando.
Zimmerman, the brain-fried Vietnam Vet from Ben Elton's Stark, who ever since he had his genitals blown off in the war has been trying to save the world with a seemingly unlimited supply of crazy-awesomeness. His greatest moments include taking a security guard hostage with his teeth and hunting down and taming a wild camel so he can ride her into battle.
In A Song of Ice and Fire, there are a number of wild, barbarian clans living in the Mountains of the Moon. One clan, called the Burned Men, ritually mutilate themselves during a coming of age ceremony, most commonly in the form of something like cutting off a finger or such. A really crazy one will take off an ear. Even the other clans think the Burned Men are Ax-Crazy. But not to be outdone, one member of the Burned Men, Timmett son of Timmett instead took a searing hot knife and put his own eye out at his ceremony. The rest of the Burned Men thought this was so crazy awesome that they made Timmett a war leader on the spot, despite the fact that he had only just come of age.
The Lannister boys (Jaime and Tyrion) repeatedly have their "what the hell, just throw it at the wall" moments that add up beyond their generalised snarkery and trolling. For example, both often respond to acutely present danger with Casual Danger Dialogue, Manipulative Badassery and just out there "planning". From "just how much wildfire do we have on hand — and, just what can be done with it?" to "you know, letting this insane bastard of a king play with it is, perhaps, not such a good idea: I should kill him, expectations be damned" — both are far from conventional thinkers.
Danaerys Targaryen aka the "Mother of Dragons" — extinct those beasts are no longer. Doing the insanely impossible, unknowable or just downright weird and, somehow, damn awesome is just part of her portfolio as a Targaryen. Be it a success or failure. Heck, past ones who just muddled through with a big "meh" of mediocrity or plain old, boring competency got questions asked about just how Targaryen they actually were. See Daeron vs Daemon and the whole Blackfyre Rebellion.
Thibbledorf Pwent. The guy walks around in armor that's covered in spikes and ridges, which badly scratches up any floors or walls he comes into contact. It does even worse to anybody he attacks, which he does by jumping on them, grabbing them, and starting to shake and convulse until they're ripped to shreds. Pwent loves doing this. He'll throw himself at a whole army and try to kill them all singlehandedly unless somebody he's actually willing to take orders from stops him, and he'll usually win in that kind of situation. He once fought a whole battle carrying the impaled body of a goblin on his helmet spike.
Sherman Alexie loves these characters, emphasis on "crazy".
In Ghost Story, Harry Dresden was able to manifest his disembodied spirit into the real world and punch a mook, specifically because he was insane. Only insane ghostly spirits can manifest physically, you understand, because it's incredibly dangerous. Oh, and the way he comes to realize he's crazy enough to do this? He remembers all the other crazy stuff he's done in previous books. And much of that crazy stuff was awesome.
It's not just incredibly dangerous, it's completely insane in a "Gravity makes things fall down not up" sort of way. Usually, the only people (Okay, ghosts) that can do it are so far gone that they forget this fact.
Special mention goes to his plan for escaping Lea in Grave Peril, which involved deliberately ingesting lethally poisonous mushrooms.
Oh dear god, Tavi. He comes up with some of the most insane plans ever, and they all actually work. Awesomely. Things like, during the defense of a bridge, throwing blood into the river to fill it full of sharks, luring his enemy into an evacuated town rigged to blow up, and frying half the enemy army with a magnifying glass a quarter mile wide. In the last book, his girlfriend correctly guesses where he's having an epic battle by thinking of the one place no one in their right mind would possibly want to go.
Wraith Squadron, from Star Wars Legends, practically exists to come up with and implement Zany Schemes that are Crazy Enough to Work. "Practically" nothing! Wedge says that's half the idea when he's trying to sell Ackbar on the scheme! He was just a LITTLE too right—most of the newly-formed squadron had quirky personalities, ranging from minor "issues" to borderline insanity. At least some of the squadron's members would not have been as effective as they were without these quirks, however, and the group as a whole could easily be considered this.
An example. When the squadron is on its way to a rendezvous and gets taken out of hyperspace and disabled by a very, very fancy mine, and is left hanging over a planet attempting repairs but aware that there's no hyperdrive, no long-range communications, and an enemy ship is on the way to see what the mine got... what happens?
What happens is that you put your hyperintelligentGamorrean pilot in a torn-out smuggling compartment with thrusters, a two-meter laser cannon, and an astromech strapped on, you put him out in space with the most damaged X-Wing which is repeating a plea for help recorded by your ex-child actor, and you wait. When the enemy ship jumps into the system and veers over to the damaged X-Wing, your Gamorrean pilot engages thrusters, steers by the astromech, enters the ship's hangar, aims the laser cannon—which was taken off one of the X-Wings—and fires straight up, blasting the captain into the ceiling. Then your pilot forces everyone on the enemy ship to surrender and invites the rest of the squadron on board, at which point it is discovered that in the confusion no one sent out a distress signal, which means the enemy does not know that this ship has been captured. Then things get interesting.
An earlier incident had the Wraiths lure an Imperial ship away from an escaping transport by faking the Millennium Falcon's signature, amplifying their own transponder signals until they looked like a squadron of fighters each, and basically yelling "come and get me". It's shortly after this that Wedge starts wondering what he's gotten himself into.
he Star Trek novel set on a Planet of Hats where the hat is Rodgers and Hammerstein. Kirk finds himself up against the Klingon captain in an elaborate farce, McCoy ends up being proclaimed The Chosen One in a Flash Gordon parody because of his breakfast order, and Scotty and Chekov end up fighting a war with the "ancestral weapon of the Scots" - golf clubs. The long-term plan is to blackmail both the Federation and the Klingons into leaving them alone by having compromising footage of both the Klingon and Federation representatives looking like idiots - and it works.
Shallan Davar in Words of Radiance claims to be an example of this. She has, quite deliberately, induced in herself a form of schizophrenia to keep the psychological effects of having killed her mother and her father from affecting her. Or at least, from affecting the fake Shallan she shows to the world.
Gabriel Gale, of The Poet And The Lunatics is a famous poet and painter who seems to be perpetually one mental misstep away from going completely bonkers. In addition to the profoundly beneficial effects this has on his art, it has several times enable him to solve crimes committed by lunatics which the police (who are generally quite sane) were unable to make heads or tails of.
Pippi Longstocking. Practically everything she says is a non sequitur or just completely insane, she regularly does things no sane person would ever do, and it is all completely awesome.