While looking into making a new cython library as explained in a pervious pull request I found out that the current pure python implementation is not threadsafe due to the use of global variables and I was wondering if contextvars or threading.local varaiables could be given a try to try and remedy the problem with the decoding tables or if a class object could be looked into to make the object threadsafe?