More importantly, with such an obvious and (more importantly) total solution off the table, it might force the designers to get more creative.
Perhaps you get a suppress spellcasting spell. Spell level 1, universal (present in all traditions.) When cast, it causes one person to be incapable of using or benefiting from spellcasting of the chosen level or lower--they cannot have those spells cast upon them, nor cast those spells personally. They make a save against its effects at the start of each turn. This induces opportunity costs: if you want to completely shut down a target's magic, you need to spend a high-level spell slot, but you never truly know what magic they might have. This would, of course, mean that creatures should have a note on any actions that are considered to be spells identifying what level, e.g. appending an "SL#" tag, such as "SL5" to indicate that a particular action is considered the use of a fifth-level spell. The absence of such a tag indicates it isn't a spell in the first place. Cantrips would, of course, be SL0.
This is something I just came up with entirely off the cuff, so there's no guarantee that it's good or wise. It just illustrates that a world where "turn magic completely off (except the things we don't want turned off)" isn't an option can actually enrich the experience rather than impoverishing it, if in its absence we come up with something more productive/interesting.
On the DM side, frankly, I would much prefer DMs needing to actually be creative with limitations they invent, rather than just resorting to the tired "your powers are shut off" trope. Kryptonite is never interesting in and of itself with Superman, and this is no different.