Use PyByteArray instead of PyBuffer

This makes a copy of the data (so is safer) and also works with Python3.