If a player is doing that, then the DM needs to craft a situation where those become detrimental. Stealth missions, Rescue Missions, requiring non-lethal force, hostage situations, diplomacy with people guarded against mind-altering spells, long endurance situations depriving the wizard of a chance to prepare a new set of spells and procure new materials. Being a living nuke isn't always beneficial.
3.5 doesn't work that way. Part of the reason the Tier 1s are so good is that they can contribute in any situation, often even better than a mundane class which specializes in that situation. Even Antimagic Fields and 'Magic Immune' monsters are little impediment to a prepared Wizard. On the one hand, it's fun because it means you're never sitting there unable to do anything. On the other hand, it can be challenging to balance, because under the standard rules, the only thing that can challenge a full caster is another full caster, or just straight out DM fiat.
No limit on spells known, genius intellect, the ability to predict the future and the ability to change spells prepared after eight hours rest mean that surprising wizard is very hard.
2-3 hours if you have a Ring of Sustenance, 5 hours with Group Trance. And you often don't even need to chance your spells. There are spells which are good in a wide variety of situations, and you can get some spontaneous casting ability too.