bpo-39947: Add _PyThreadState_GetDict() function (GH-19160)

diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index 4ea509d..2709727 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -149,6 +149,8 @@
  * if it is NULL. */
 PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void);
 
+PyAPI_FUNC(PyObject *) _PyThreadState_GetDict(PyThreadState *tstate);
+
 /* PyGILState */
 
 /* Helper/diagnostic function - return 1 if the current thread