So the question then becomes how to adjudicate a high volume of fire without ruining the fantasy of being able to fill a mutant crab full of lead?
For me this is when it starts to veer less into how I would adjudicate a gun within the same base setting as "typical" D&D and more about how our choices of inclusion tailor the setting and story being told.
A weapon that we want to be used in that way, to impact targets in that way, means combat would adjust accordingly. Consider any other form of entertainment, from film & TV to books, and the types of encounters one expects to see when the heroes are either wielding swords and arrows or LMGs.
Just like the game and world changes if the players have horses vs a ship, or an airship, or a spelljammer. A spelljammer ship won't ruin the fantasy because we'd be making the fantasy to specifically include spelljammer ships. If the fantasy was centered around horse travel, there wouldn't be spelljammer ships. Do I put a point of interest in the nearby forest, or another planet? Is the villain a conquering warlord from a neighboring nation, or an alien invader?
Similarly, am I fighting a mutant crab, or am I being swarmed by mutant crabs?
I don't think they had the mathematics, specifically calculus.
There's a fair few technological advancements they would have had to leap frog past to make it work, barring a more fantastical what-if scenario where their industrial revolution would have no overlap or comparison to the one that did happen.
Something I'd read once put it as they hadn't even yet reached the apex of what wooden tools can do, let alone encountered the need for the mechanical.