I have a device in my kitchen called a Food Saver. It enables you to seal and safely freeze meat or fish. The machine sucks all the air out and then heat seals the plastic bag. You could seal a pistol but the bags aren’t large enough for a rifle. I can’t imagine why you would want to do that anyway.
The plastic comes in rolls that you can use to seal a rifle.
I suggest double bagging and include oxygen scavengers.