[FEAT] Add environment variables for `njit`'s `cache=True` and `nogil=True`
Is your feature request related to a problem? Please describe.
To speed up numba functions, cache=True can be used to avoid compilation times each time the function is invoked; and nogil=True can be used to release Python's GIL which can be useful since when doing multiprocessing numba compiles the function for every process.
Describe the solution you'd like I've been thinking about a solution for a while and I think the best thing to do is to include environment variables for each argument, as suggested here.
Describe alternatives you've considered
Maybe default both arguments to True, but it is too restrictive.
This should also resolve https://github.com/alan-turing-institute/sktime/pull/2527.
Is there any update on this ? Seems, currently it is neither directly possible in Numba or in the StatsForecast package. But would be really useful feature. I thought of enabling cache by default and let the users use the numba environment [NUMBA_DISABLE_JIT] (https://numba.readthedocs.io/en/stable/reference/envvars.html#envvar-NUMBA_DISABLE_JIT) to toggle using the caching function but using that environment variable results in errors.
This was added in #651