Most of these hypothetical scenarios don't apply to the game as it is actually played. In actual games, the two main ranged classes are not considered that great, and you don't really need a ranged specialist in your party, not the way you need a tank, a caster, and a healer. Or if you do, it's not for their ranged attacks but for their scouting abilities. I run plenty of wilderness encounters and long range archery duels just don't happen. Nor do you see many scenarios that favour ranged attacks in published materials, especially when compared to the number of encounters that are built around melee battles.
The reality of encounters in D&D is that they overwhelmingly take place in tight quarters with lots of obstacles available. Long range is seldom a factor for bows/x-bows, and in general you wouldn't want any party members to be that far away from the fight anyway. Hypothetical arguments aside, ranged attacks are not a problem in the game as it is currently designed. Unless you are designing encounters just to favour ranged attackers, in which case, do less of that.
Absent terrain/visibility restrictions, a melee warrior using the dash action will need 20 rounds to close with a longbow wielder stepping backwards while firing. That may be an extreme case, but having to endure even half a dozen rounds of fire, even with partial cover intermittently available, is a sufficient obstacle that, under 5e rules, no one in their right mind would come to an outdoor battle armed primarily with a melee weapon.
"Absent terrain/visibility restrictions" - okay, so basically never. Parties have outdoor encounters
all the time and melee characters do just fine. Excellent, even. No DM ever sets up an encounter where the PC has no choice but to endure 6 rounds of ranged attacks to get into combat. The only way that happens is if the DM is being malicious, or the players are choosing to do something idiotic.
If the DM presented me with a situation where my fighter had to charge for six rounds through wide open terrain in order to reach a ranged attacker, I am going to assume that the message is "find another way." And we would retreat and figure out a plan, look for the secret entrance that is no doubt nearby, use an invisibility spell, circle around to behind the archer, or whatever. If I just Leroy Jenkins it, I deserve what happens.