Improve AnkiConnect and other add-on performance on large collections

In Python 3.13.2 a new feature has been introduced to disable the Global Interpreter Lock, which allows for proper multithreading.

Free-threaded CPython
CPython now has experimental support for running in a free-threaded mode, with the global interpreter lock (GIL) disabled. This is an experimental feature and therefore is not enabled by default. The free-threaded mode requires a different executable, usually called python3.13t or python3.13t.exe. Pre-built binaries marked as free-threaded can be installed as part of the official Windows and macOS installers, or CPython can be built from source with the --disable-gil option.

To my understanding, currently when multiple queries are passed through AnkiConnect (for those using Yomitan they often are when checking duplicates), they are run in series rather than parallel due to the GIL and take a noticeable amount of time to complete on large collections. To mitigate this, I suggest that Anki ships with this new feature enabled. It should theoretically also speed up other add-ons if they’re complex enough.

That’s not due to the GIL, but rather this. The backend doesn’t currently support concurrent collection ops

EDIT: Sorry, this isn’t the full picture. There’s another lock within the backend instance itself in rslib that’s used when querying the collection db. Also, from what i understand, anki is stuck on 3.9.18 for the time being due to the way its packaged