It is usually the former British colonies that are the biggest pain in this regard. There are lots of thoughts on this subject from various experts. Choice One is a semi-automatic shotgun. However, this is only good for close-in work. However, rifles are very difficult to use effectively from the deck of a small boat - unless conditions are calm.
Pistols are good for close-in work, but are the biggest hassle with local authorities.
Some flare pistols can be used with shotgun shells. But then, if there is an intruder already on the boat it may be better to cooperate.