Avoid acquiring the GIL at the end of nogil functions (GH-3556) (GH-4703)
Acquire the GIL in nogil functions only when strictly needed on function exit, e.g. for cleaning up temp variables from with-gil blocks or adding tracebacks. Closes GH-3554 Closes GH-4637
Showing