Implement a bunch of pickle serialization features that optimize for size. (#23759)
Summary:
This saves about 10KB of compressed size on FaceBlaze. https://github.com/pytorch/pytorch/issues/23582
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23759
Differential Revision: D16641664
fbshipit-source-id: 5a7cec1a1b5123bb2a3eaa21ea12e041be551561