Use ctypes.byref() instead of pointer() to pass arguments by reference