Every nation’s laws are different. And besides the law on the book, some countries are lax and some are rabidly anti-gun when it comes to visiting yachts. Mexico, for example. I would throw my guns overboard if I had to make an unplanned diversion to a Mexican port. In fact, I did.
But basically, you plan your route around which countries won’t go nuts because of your guns.
And every nation’s laws vary in another way. In the USA, the big distinctions are semi-auto or full-auto. In much of the world, you can’t have certain “military” calibers, and don’t care that your weapon is legal back in the USA.
Some people get an old milsurp bolt gun like an Enfield, and call it their “shark gun.”
Compound bows, spearguns and big 25mm flare guns are also useful where guns are not allowed.