bpo-32241: Add the const qualifire to declarations of umodifiable strings. (#4748)

diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c
index 610541d..2762f46 100644
--- a/Python/bootstrap_hash.c
+++ b/Python/bootstrap_hash.c
@@ -533,16 +533,16 @@
     return pyurandom(buffer, size, 0, 1);
 }
 
-int Py_ReadHashSeed(char *seed_text,
+int Py_ReadHashSeed(const char *seed_text,
                     int *use_hash_seed,
                     unsigned long *hash_seed)
 {
     Py_BUILD_ASSERT(sizeof(_Py_HashSecret_t) == sizeof(_Py_HashSecret.uc));
     /* Convert a text seed to a numeric one */
     if (seed_text && *seed_text != '\0' && strcmp(seed_text, "random") != 0) {
-        char *endptr = seed_text;
+        const char *endptr = seed_text;
         unsigned long seed;
-        seed = strtoul(seed_text, &endptr, 10);
+        seed = strtoul(seed_text, (char **)&endptr, 10);
         if (*endptr != '\0'
             || seed > 4294967295UL
             || (errno == ERANGE && seed == ULONG_MAX))
@@ -604,7 +604,7 @@
 _PyInitError
 _Py_HashRandomization_Init(_PyCoreConfig *core_config)
 {
-    char *seed_text;
+    const char *seed_text;
     int use_hash_seed = core_config->use_hash_seed;
     unsigned long hash_seed = core_config->hash_seed;
 
diff --git a/Python/dynamic_annotations.c b/Python/dynamic_annotations.c
index 10511da..7febaa0 100644
--- a/Python/dynamic_annotations.c
+++ b/Python/dynamic_annotations.c
@@ -120,7 +120,7 @@
 #endif
 
 #ifndef _MSC_VER
-  char *running_on_valgrind_str = getenv("RUNNING_ON_VALGRIND");
+  const char *running_on_valgrind_str = getenv("RUNNING_ON_VALGRIND");
   if (running_on_valgrind_str) {
     return strcmp(running_on_valgrind_str, "0") != 0;
   }
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index 77602d7..a3b6196 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -23,7 +23,7 @@
         exit(1);
     }
 
-    char *p;
+    const char *p;
     int i, n, sts = 1;
     int inspect = 0;
     int unbuffered = 0;
diff --git a/Python/pathconfig.c b/Python/pathconfig.c
index 6a03f7d..53ddfc9 100644
--- a/Python/pathconfig.c
+++ b/Python/pathconfig.c
@@ -168,7 +168,7 @@
 
 
 void
-Py_SetPythonHome(wchar_t *home)
+Py_SetPythonHome(const wchar_t *home)
 {
     if (home == NULL) {
         return;
@@ -189,7 +189,7 @@
 
 
 void
-Py_SetProgramName(wchar_t *program_name)
+Py_SetProgramName(const wchar_t *program_name)
 {
     if (program_name == NULL || program_name[0] == L'\0') {
         return;
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 0b3aa98..fdb09d9 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -414,7 +414,7 @@
     {NULL}
 };
 
-static char *
+static const char *
 get_default_standard_stream_error_handler(void)
 {
     const char *ctype_loc = setlocale(LC_CTYPE, NULL);
@@ -440,7 +440,7 @@
 }
 
 #ifdef PY_COERCE_C_LOCALE
-static const char *_C_LOCALE_COERCION_WARNING =
+static const char _C_LOCALE_COERCION_WARNING[] =
     "Python detected LC_CTYPE=C: LC_CTYPE coerced to %.20s (set another locale "
     "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior).\n";
 
@@ -1757,7 +1757,8 @@
     PyObject *std = NULL;
     int fd;
     PyObject * encoding_attr;
-    char *pythonioencoding = NULL, *encoding, *errors;
+    char *pythonioencoding = NULL;
+    const char *encoding, *errors;
     _PyInitError res = _Py_INIT_OK();
 
     /* Hack to avoid a nasty recursion issue when Python is invoked
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index eeeaa72..f10099b 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -100,7 +100,7 @@
 sys_breakpointhook(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *keywords)
 {
     assert(!PyErr_Occurred());
-    char *envar = Py_GETENV("PYTHONBREAKPOINT");
+    const char *envar = Py_GETENV("PYTHONBREAKPOINT");
 
     if (envar == NULL || strlen(envar) == 0) {
         envar = "pdb.set_trace";
@@ -109,8 +109,8 @@
         /* The breakpoint is explicitly no-op'd. */
         Py_RETURN_NONE;
     }
-    char *last_dot = strrchr(envar, '.');
-    char *attrname = NULL;
+    const char *last_dot = strrchr(envar, '.');
+    const char *attrname = NULL;
     PyObject *modulepath = NULL;
 
     if (last_dot == NULL) {
diff --git a/Python/thread.c b/Python/thread.c
index 7eac836..0774384 100644
--- a/Python/thread.c
+++ b/Python/thread.c
@@ -61,7 +61,7 @@
 PyThread_init_thread(void)
 {
 #ifdef Py_DEBUG
-    char *p = Py_GETENV("PYTHONTHREADDEBUG");
+    const char *p = Py_GETENV("PYTHONTHREADDEBUG");
 
     if (p) {
         if (*p)