Carrying ammo into a foreign country is often the same as carrying the firearm itself. Also, in most states in the US you either need a gun permit for that flare insert or they are straight up illegal like in Massachusetts.There are also Czech and Polish military surplus 26mm flare guns that you can get for about the same price as a cheapy plastic 12g gun from WM. Flares are avail too but will expired, however I just carry regular hand flares for compliance, and use the pistol as the arial signal device, or backup. It's a real flare gun, with military ammo.
Anyway, there are conversion kits to make them into 45LC and .22 single shot pistols. Stow the conversion kit in the junk parts box, nobody will know what it is. Then use it in dire emergency, which will never happen but if it does then you can fire back and send him a .45 caliber missile, IE the villain is in your cabin and about to murder you. And you never had to worry about being arrested in foreign ports.
If you are just going to the Bahamas and feel you must have something onboard, just get a Mossberg Mariner 500 and declare it on entry. Not a big deal in the Bahamas. The rest of the Caribbean it could be a major issue. And never try to hide a gun from customs. That is gun smuggling and treated very harshly. They are smarter than you in this regard and will find it.
But as others have pointed out, if you use it there will be hell to pay. There is not castle law or stand your ground law to get you out. Self defense better be in similar response. Even if you shoot a guy wielding a knife you will have to spend time and money to deal with it.
My decision will mostly be kept private. But the advice you often read about not making yourself a target will be my biggest defense. I wont be flashing jewelry or cash around. I will pick my anchoring locations wisely. My 31-footer won't be the best looking boat in an anchorage. And no guns will be known to be onboard because that will make you a target as much as cash or jewels.
Like Stu always says, your boat your choice. But you better fully understand that choice.
Fair winds,
Jesse