Feature or enhancement
The current weakref implementation relies on the GIL for thread-safety.
The nogil-3.12 fork substantially modifies the weakref implementation. I think we can implement a simpler change in CPython 3.13 (main) now that all PyObject's have their own mutex (in --disable-gil builds).
Basic idea
Protect access to the weakrefs linked list using the mutex in the weakly referenced object. Use the critical section API.
Prior implementation: colesbury/nogil-3.12@0dddcb6f9d
Linked PRs