Get rid of buffer(). Use memoryview() in its place where possible. In a few places, do things a bit different, because memoryview() can't slice (yet).