If I were to go about this for any reason I would do it this way:
1. Use a good oil or grease to coat all metal parts.
2. Use a Mylar bag.
3. Use a bigger than needed oxygen absorber to go into the bag with the firearm. (no oxygen = no rust). A new oxygen absorber should feel soft to the touch when you squeeze it, like it has sand inside, if it feels hard when you squeeze it then at some point oxygen got to it and it should be discarded.
4. Seal the mylar bag with an iron set on highest setting with a minimum 1 inch wide seal. 5-8 seconds of contact with the iron should make an awesome seal, if the bag is longer than the iron do it in sections until the bag is completely sealed.
If you are burying the firearm, do not trust the mylar bag to protect it, place it inside of a piece of pvc pipe which is pvc-cemented on one end, and on the other end use a threaded cap which you use teflon tape on the threads to ensure a water proof seal. You can also just glue both endcaps on but you will need a saw to get into it later on when you go to open it again, and to reuse it you will need a new endcap and more pvc cement and primer if your cement calls for it. Throwing several large oxygen absorbers in the pipe with the bag is probably also a good idea in case the mylar bags seal got compromised....