One thing I tend to do as standard in "magic and explosives" settings is have a few spells, items, and abilities that are some variant of "summon a swarm of small hyper fire elementals that love to hug explosives."
This does not outright
prevent the use of explosives, and of course there are mundane and magical counters, but:
- It is fun. Chaos, tiny critters, explosions! (I recommend making the tiny elementals look like fire kittens or golden lion tamarins.)
- It reduces the dominance of guns over other strategies seen in RL.
- It reduces the players' tendency to apply high explosives to every problem, which in my experience gets tedious after a while.
- It encourages creativity on the players' part.