I have a confession to make.
I used to be a horrible munchkin, powergamer, min-maxer, roll-player, or what-have-you (I prefer Optimizer, but that's just me). I'll post some of the stories eventually if you don't believe me; the particular exploits aren't really the point.
The point is that I'm getting better (Honest!). There are only so many character-bans a body can take before he starts to question the behavior generating the bans. And I came to the conclusion that the problem with powergaming wasn't really having too much power, but that it made everyone else feel like they had too little power. And so, in a bit of social min-maxing, I developed the way of the enlightened powergamer. Basically, it boils down to "In Case of Emergency, Break Game." Build characters with absolutely catastrophic capabilities... and then don't use them unless you really, really have to.
I kind of stumbled across this in the Mongoose Encyclopedia Arcane books, particularly Dragon Magic, and later Demonology. Both of these forms of magic have excellent rewards; Dragon Magic lets you get free metamagic with a successful skill check during casting, and Demonology can do all sorts of handy things. But... they've both got their prices. If you screw up the skill check for Dragon Magic metamagic, Bad Things happen, ranging from spells backfiring to you being sucked through a rip in reality to the astral plane or having your magic turned off for a while. And Demonology naturally carries a risk of possession, in addition to the possibility that you'll fail to control summoned demons and they will attack you, or that an angry mob will come a'knocking on your door with pitchforks and torches. So both of these carry the potential for great gain at potentially great cost. So when I started using them, I used them very sparingly; I had a sorcerer with Dragon Magic who never used it during the campaign's entire life. If he had, he could've done some very powerful things... but it was never necessary, or deemed worth the risk.
From this precedent, it was fairly easy to generalize to all other extreme sources of power, except that the balancing constraint is the ire of one's fellow players. So here's how it works: first, during character creation, you satisfy your inner theorycrafter by building an exceptionally powerful, perhaps broken, character. Then, during 'normal' play, you lay low and play like a normal member of your class if at all possible. Thus, the rest of the players don't resent your capabilities, and the DM doesn't catch on and errata or ban you. Only when the chips are down and the party is losing badly (say, 2 members unconscious or dead) do you pull out the stops and go full-power. Then, the rest of the party (and potentially the DM as well) thank you for preventing a TPK (Total Party Kill), if you're successful, and if you're not, then you've all ended up dead and your powergaming is no longer a concern (not only because your character is dead, but because you evidently failed at the powergaming, or you'd still be alive). Generally, DMs don't aim for TPKs - if you've put effort into planning a campaign, killing all the characters is a waste of previous work, and therefore not efficient. And if you happen to have a malicious DM who does gun for TPKs, then there's nothing you can do about it but try to die valiantly - even if you manage to pull through this extreme threat, there'll just be more.
So: socially optimal powergaming. You get your theory-crafting fun, your fellow players don't get angry at you, and the DM is none the wiser. Further, if you have to go nova and the DM is happy that there wasn't a TPK, then you've earned credibility as one who can play a broken character responsibly, as a TPK Prevention Mechanism. This means that that DM is more likely to let you get away with strong builds in later games because they won't be worried about you screwing stuff up, because you've proven that you won't. So it's a positive feedback loop - the DM can build encounters with less caution against TPKs, you can build characters with less oversight, and your fellow players get to stay alive but still feel good about their characters. All for the price of just a little restraint. And what's more, you also benefit your fellow powergamers by combating their bad name.
So: Responsible Powergaming. Only YOU can prevent TPKs.