D&D is *definitely* a game constructed to allow the Barbarian to break cover and rush into melee.
I'm not saying it isn't able to allow a Barbarian to rush into melee even in the face of twanging crossbows or dragon's breath or the like - given the right sort of character, at the right levels, wearing the right armor, with the right good save. Just that: 1) it doesn't do it without some willingness to be flexible when it comes to visualizing the character and what hps mean in the story and 2) it wasn't designed explicitly to do that one thing and prevent doing anything else, rather, with the same degree of flexibility & imagination, you can use the hp mechanic to model the plot armor that crops up in wildly different genres. \
That's possible precisely because it is such an abstract mechanic.
Referee: Alright! Walk ten paces forward, dive for cover, then turn and shoot!
That's a European pistol duel. An Old West "Showdown" had no referee or seconds, and you faced eachother the whole time.
But that'd probably require it's own special rules in a 5e adaptation.
Yeah, I'd probably do something similar - area effect in a cone maybe. The primary purpose of machine guns is primarily suppression fire.
Yeah, it was the equivalent of a 5e cone, IIRC. Oh, also, the suppression fire comment just reminded me: the minigun (I think I mistakenly referred to it as a chaingun at the time) was an AE that attacked everyone in the area, /if it missed, it knocked you prone/. Not because it was shooting out bolas or anything, but because dropping prone is just a very plausible & genre-appropriate way of avoiding being hit by a hail of bullets.
There's probably a lot of things you could apply on a miss (or even a hit that does less than some threshold of current hps, perhaps), that way, to enforce genre conventions.