I suspect most DMs simply handwave it that the faux-Chinese in their settings never invented gunpowder, for whatever reason, and leave it at that.
Don't see why you'd need faux-Chinese when you have dwarfs, gnomes, and dozens of other sentient species who have a reason to blow things up and a tendency to experiment with materials and chemicals. And even if they never do it, humans have a tendency to blow things up and experiment with materials and chemicals.
Honestly, I think that if you ever need to come up with racial traits for human beyond a generic "we're good at everything and so get a small bonus to stats/skills," blowing stuff up and experimenting with stuff we probably shouldn't should be our species' hat. Human like big boom.
One could argue, given the prevalence of monsters and threats in a typical D&D setting that our own history never had to deal with, that such technological innovation never gets much of a chance to take root because those who might do it are too busy dealing with those threats instead.
Well, in the real world, the more threats there are, the more people focus on creating tools to deal with those threats... like newer, better weapons. Unless you go for a post-apocalypse feel. But if you have people who have money (nobility/royalty), then they
will get people to make newer, better, and more deadly instruments of war and means of protection, and that
will lead to advancements in other fields as well.
(Now I want to watch Connections again.)
That, and in a D&D setting "academia" is largely replaced and-or supplanted by "magical studies"; the brightest minds tend to either go into magic or adventuring, or both. Which means, it's more likely that a new spell will be invented to solve [generic problem x] than a new technology, with the side effect of keeping that solution gated behind the ability to cast spells and thus exclusive to the casters - who can then profit from it as they like.
Problem here is that someone will eventually figure out how to make versions that don't require magic.
Magic for the masses is the main thing that makes Eberron an atypical setting.
While Eberron is not my favorite setting, it's honestly the most logical. D&D magic is not only repeatable but reliable. A spell will always work, and always in the same way (with the
very rare exception of spells like
teleport). There's no rolls to cast the spells and no problems with miscasts causing problems (except for wild mages, assuming that the edition uses them), and there are no limitations as to who can cast, beyond, perhaps, a minimal Int score or (ugh) racial limitations.
So logically,
unless the GM introduces something into the setting that seriously limits spellcasting in some way (either rules or some sort of in-fiction limitation), every D&D setting
should be magitech. And if the GM
does introduce something that limits casting, then there
should be higher levels of real-world tech. Including guns.
(Or you can just go "%&*! logic" and simply not have them in the world. And if a player wants to
create them, well, they're playing with explosives and have to roll
really well not not die while doing it. Or simply set your game in the stone or bronze ages, not the iron/medieval/renaissance periods that are typical.)
In thinking about it, it might be better to simply have magic be the real-world equivalent of electronics, not mechanics--let the nonmagical folk create their tech, but they'll be building with clockworks and steam and primitive internal combustion while the wizards have computers with AI (bound spirit) and holographic (illusory) interface that let them hack the world, Mage: the Ascension style. At least that way, if someone magic-less mortal tries to reverse engineer such a device, they'll release the spirits and probably get killed by them in the process.