Re: avoiding Python function calls, one of my tricks to avoid them is to set a `nogil` decl on the function and hack on it till it works :)