cleaner attempt at nogil'ing some C API calls