title: For Base64 encode, prefer str.encode('base64_codec') or base64.b64encode(str)?
body: <p>In Python library, there is base64 module for working on Base64. At the same time, if you want to encode a string, there is codec for base64, i.e. <code>str.encode('base64_encode')</code>. Which approach is preferred?</p>