Magic memoryview() style casting for Cython