grextras: remove some ctypes usage for safe_as work