There should be an option to have shiboken2 not deal with the GIL in generated code per default. This could be enabled on the command line of shiboken2 or via the typesystem.xml. Scope should be global or at least per type (class).
It's all about code generated like this (for most, if not all, methods):
I don't want shiboken2 to do those PyEval_SaveThread()- / PyEval_RestoreThread( _save )-calls. Reason: I don't want shiboken2 to make assumptions about the code the user may add there. In my case, for instance, I really need to hold the GIL there in many cases.
I've read about the "modify-function" node along with "allow-thread" here: modify-function. This is nice but would require me to apply it to each and every method (I've really a lot of those )