There's the base64 module in the standard library. It can encode and decode base64, base32 and base16 ("hex").
FYI, encoding is not the same as encryption. Encoding means converting data to a different format that can be converted back to the original format. For example, converting audio files to MP3, saving an image as PNG, writing a plain text file as UTF-8 or encoding data in base64 are all encoding, not encryption. In all cases you are able to (and want to) get back the original data.
Encryption means converting data in a way that normal people cannot easily find out the original data, but the intended recipient can. For example HTTPS (which uses SSL/TLS) is encryption - by looking at the data that is sent between client and server, you cannot see what they are talking about, but if you access a website over HTTPS your browser can display the result.