Encode the name variable for having a buffer interface in Python 3