I’ll buy the “shields are necessary, just like modern peaceful cargo ships have hulls that can stop bullets” argument a lot of the time. But the gun turrets thing… Yeah, always seemed a little weird, in terms of space-opera settings.
Get a little more towards the hard-SF end and you find yourself noting that ANY spaceship is less like a truck and more like rolling around in a nuclear-powered sub. It’s really not worth quibbling about whether I’m allowed to bolt on a deck gun or not, because there’s a fucking nuke in there. This is, I think, part of Traveller’s heritage? But I’m mainly thinking of Cherryh’s Union/Alliance stuff,* where sure, ships are armed I guess, nobody really talks about it in quite those terms because what would an “unarmed starship” even mean? Okay, you don’t have a purpose-built flak cannon, so you’ll have to dump a shipping container of ball bearings at .07c if you want to wipe out my station. It’s significant that the thing civilian spacers really freak out about when purpose-built warships show up in Cherryh isn’t “that thing carries how many guns/missiles?!?” but rather their acceleration and jump capabilities.
But then, also worth noting that ships are treated like junior state actors in Union/Alliance and are expected to behave on that level. If some merchanter showed up acting as feckless as a bunch of PCs, well, expect to be answering some really serious questions before the police guard lets anyone back aboard.
So again, not exactly dodging that “real serious social implications for your game-world” issue, just relocating them from “how fucked is your society that everyone walks around loaded for pirate” to “um, apparently we trust feckless player characters with the world-destroying power of a starship now?”
*”I’m mainly thinking of Cherryh’s Union/Alliance stuff” is also a true statement about my lifestyle.