In D&D/Pathfinder...there is no need to develope guns because wizards are very good at blowing stuff up.
1) Logistics. Training someone to shoot a gun can take less time than it does to train someone to cast spells. It might be monetarily efficient, depending on available resources. Not to mention that the place that develops guns might have fewer wizards, have outlawed wizardry. Also, non-wizards might want to be bale to kill things like dragons. IT takes a HIGH level wizard to kill a dragon with a spell, but a canon ball would probably put a serious dent in a dragon. And anyone can light a fuse and detonate a bomb, but it takes individuals trained in Use Magic Device to use any sort of explosive magical item.
2) The world changed due to guns. Castles, for instance, changed when cannons could blast down their walls, etc. But the same would hold true for magic. Take for instance ye olde Castle with a walled courtyard. If a wizard can just cast a fly spell, if someone can get an item of flying, or any number of winged monsters could just drop down into the courtyard. THerefore, the nature of castles would have to change. They haven't, in response to wizardry. In fact most genre conventions are stuck in the medieval period, not responding to the advances of magic and monsters that would have changed those things. So, why would guns?
But hell, the invention of the Longbow was the trump card vs. full-plated knights, and changed the face of warfare. Yet if we can have longbows in a game with full plated cavalry, then we can have guns in a game with armor plated dudes.
Ultimately, the problem of guns comes down to a few things.
A) Balance. Because you have to say "Well guns are damaging and powerful, how do we prevent that?" "Well we can make them super powerful but we limit the loading time/cost per shot" "Or we could make them weak so that they are balanced with other weapons." "Damnit"
B) "Get your x out of my fantasy" Guns are like Psionics or Monks. Some people really like them. Other people just do not consider them
fantasy at all. No amount of argument will win because it's a matter of
feeling, not thinking. The only two choices is "grin and bare it because you friend likes it" or "Ban it from the game".
My solution?
Try to make guns feel fantasy-like. Instead of trying to say, create a powder that explodes shooting a metal ball down a tube, what about something that throws an alchemical grenade? Or something that sprays greek fire (like a flame thrower)? Exalted's Fire Wands shoot actual jets of flame, as opposed to lead balls. A javelin-launching
potato gun should be easy to rig with lamp oil and a pipe.
And if you just want the feel of two-fisted pistol shooting, there are magical properties for ranged weapons that give them infinite ammo - so something that can just be held in the hand and launch projectiles without reloading could do the job.