We have no beaches here, so I am not sure what you are talking about exactly. Right now it's -17 degrees so swim trunks don't get much consideration.
I believe you mean a gun to carry in a bag while you are in swim trunks. Am I correct?
If that is the case, maybe what you need is an AK-47 with a folding stock? One with a short magazine carries nicely in a bag, and they run in sandy conditions very well.