We purchased one from a cruiser that was going to Mexico and didn't want it aboard. Beautiful gun, Stainless pump action shotgun. I cut the barrel and stock off as short as possible still having a working gun. When we were north of Belize I tossed it overboard. Basically we had it from Panama to Mexico in the Western Caribbean for about a year. I had a good secure hiding place that was easy to get to. All I needed was the prybar I kept 3 feet away to pop the wood off.
I don't like guns aboard as I feel the likelyhood of pulling it out at the wrong time over rides the possible protection it might give at the right time.
We generally chose to use noise, lights and flares. I keep a flare gun and the air horn next to the bed. My feeling is that 90 percent of the time the noise lights and flares would cause too much attention in areas where you're not alone for thieves and they'd take off. I also have 4 flare guns so in an emergency I can point and shoot over and over (at least that's the plan). The other 10% (when you're in an isolated area with thugs carrying guns) is the difficult one. We had friends beat up and other friends shot (survived) with no provication. The thugs boarded, had guns and got ugly. Real ugly. That's when a gun for protection may have been useful. Pulling a gun out could just as easily have gotten them killed as 3d world gun carrying thugs don't care.
Cruising in the US I would consider carrying a gun. Traveling in 3d world areas where life is cheap I don't know and that's when you could benefit the most.