Issue #19512, #19515: remove shared identifiers, move identifiers where they
are used.

Move also _Py_IDENTIFIER() defintions to the top in modified files to remove
identifiers duplicated in the same file.
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 5cdd926..1f192dc 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -2578,7 +2578,7 @@
     if (fd == -1) {
         PyObject* sys_stdout;
 
-        sys_stdout = _PySys_GetObjectId(&_PyId_stdout);
+        sys_stdout = PySys_GetObject("stdout");
 
         if (sys_stdout == NULL || sys_stdout == Py_None) {
             PyErr_SetString(