It is best to do as they say, stand aside and let them to their thing. It may be scary the first time to have armed, and I mean large automatic weapons, men climbing around your little boat, but we haven't heard of any problems. A permit to take a gun into Mexico is issued only in conjunction with a Hunting permit which is issued only for the period of the hunting season. This season depends on the area in which you would intend to hunt, and can be expensive if you intend to travel through several states. The same applies if you wish to have a gun onboard a vessel while cruising Mexican waters.
Many yachts have a shotgun onboard for protection and run the risk of loosing the gun.
A hand gun is absolutely not permitted and will definitely be taken if found. Depending on the official, you may or may not loose the shotgun. Once the gun permit is issued with the hunting permit it must be renewed 60 days after the issue date, which in turn is then good for another 60 days when it then expires.