Use the new numpy c api that require PyArrayObject as input.