Suppose you have a MD5 hash encoded in base64.  Then each
character needs only 6 bits to store each character in the
resultant 22-byte string (excluding the ending '==').  Thus, each
base64 md5 hash can shrink down to 6*22 = 132 bits, which
requires 25% less memory space compared to the original 8*22=176
bits string.
Is there any Python module or function that lets you store base64
data in the way described above?
"store base64 data"

Don't.
Do. Not. Store. Base64. Data.
Base64 is built by encoding something to make it bigger.
Store the original something.  Never store the base64 encoding of something.
Most memory-efficient way of holding base64 data in Python?