If you don't declare weapons AND you are caught, the boat, the weapon may be confiscated and jail time is a high probability. The only option is if you have them declare them and turn them in to the country.
My solution, don't go there if they won't let you keep them secure on board.
I have sailed into two dozen countries with weapons. Sometimes I declared them, sometimes not. I never once got a “down to the keel bolts” search. Never.
Thanks....I wondered....do they strip search people at ports, though? And, yeah....if you can’t protect yourself somewhere....don’t go there! Wouldn’t you think though that if you are out on the high seas where Pirates hang out you’d take the risk of having protection?