The rowboat in the core rules is stated to weigh 100 pounds. It is further described in Ghosts of Saltmarsh to be large enough for 4 creatures (2 crew, 2 passengers), and sized 10 feet by 5 feet. This is similar to this question about flying carpets, but here the rules explicitly tell us that 4 creatures fit into the boat, so there is no question about how many creatures actually can use this vehicle.
This however leads to a similar dilemma of how to deal with creatures that are densely packed at the beginning of combat, and under circumstances that make it undesirable or harmful for them to change that arrangement, and maybe this here is a better example, involving only mundane objects: what happens if the boat now is attacked?
Say, traveling through a watery swamp by boat, the adventurers are attacked from the water by Lizardfolk. It seems ridiculous that two of the four characters would jump into the water, because they "cannot willingly end their turn in another creature's space". In a similar combat encounters I have experienced as a player, the DM handwaved the space requirements for combat, allowing the PCs to fight back from the boat.
It feels even more ridiculous with a longship (70 ft. by 20 ft., 140 passengers and crew), which could accommodate just 56 medium or small sized creatures under combat conditions. So, every time two longships engage in battle on water, most of the warriors on board have to jump into the water? That is surely not how real-world sea battles have played out.
Are there rules that can guide handling an exception here, in addition to rule 0 (for example, fighting with disadvantage due to cramped circumstances)?