Also worth noting: A wheellock pistol within arm's reach of a person with a sword and lethal intent would be useless.
I mean, that hasn't changed. An individual with a holstered gun being surprised by someone within 20 feet with a knife is almost certainly going to be mortally wounded before drawing their gun. Training videos for police tell you that if an attacker is closer than 10 feet you will be wounded before you have drawn your weapon
even if you're on guard. Melee range is a lot further than you'd think. People are fast, reactions are slow.
Back to the original point, I think the problem is back to the design of the weapon table:
A dagger deals 1d4 damage. So does a throwing knife or dart.
Shortbows are a two-handed weapon, so they need to be better than daggers and darts somehow. They deal 1d6 damage.
Longbows are martial, so they need to be better than shortbows somehow. They deal 1d8.
Light crossbows have the loading property, so they need to be better than shortbows somehow. They deal 1d8 damage.
Heavy crossbows are martial, have the loading property,
and are heavy, so they need to be better than everything above. They do 1d10 damage.
Guns are exotic, and they require rare and exotic ammunition (gunpowder) that as a rule can't easily be produced. They should outclass everything above. Pistols do 1d10, muskets do 1d12.
In short, can we please have class-based weapon damage rolls?