Issue #25923: Added more const qualifiers to signatures of static and private functions.
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
index 0c6eae2..3c48ff3 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -60,7 +60,7 @@
    * Otherwise, the line ending is specified by readnl, a str object */
 extern Py_ssize_t _PyIO_find_line_ending(
     int translated, int universal, PyObject *readnl,
-    int kind, char *start, char *end, Py_ssize_t *consumed);
+    int kind, const char *start, const char *end, Py_ssize_t *consumed);
 
 /* Return 1 if an EnvironmentError with errno == EINTR is set (and then
    clears the error indicator), 0 otherwise.
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 6bb2200..16f8cdf 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -659,7 +659,7 @@
 
 /* Sets the current error to BlockingIOError */
 static void
-_set_BlockingIOError(char *msg, Py_ssize_t written)
+_set_BlockingIOError(const char *msg, Py_ssize_t written)
 {
     PyObject *err;
     PyErr_Clear();
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index dbd604a..8bf3922 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -540,7 +540,7 @@
 }
 
 static PyObject *
-err_mode(char *action)
+err_mode(const char *action)
 {
     _PyIO_State *state = IO_STATE();
     if (state != NULL)
@@ -1043,7 +1043,7 @@
 }
 #endif /* HAVE_FTRUNCATE */
 
-static char *
+static const char *
 mode_string(fileio *self)
 {
     if (self->created) {
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index d018623..140da10 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -1648,8 +1648,8 @@
 /* NOTE: `end` must point to the real end of the Py_UCS4 storage,
    that is to the NUL character. Otherwise the function will produce
    incorrect results. */
-static char *
-find_control_char(int kind, char *s, char *end, Py_UCS4 ch)
+static const char *
+find_control_char(int kind, const char *s, const char *end, Py_UCS4 ch)
 {
     if (kind == PyUnicode_1BYTE_KIND) {
         assert(ch < 256);
@@ -1669,13 +1669,13 @@
 Py_ssize_t
 _PyIO_find_line_ending(
     int translated, int universal, PyObject *readnl,
-    int kind, char *start, char *end, Py_ssize_t *consumed)
+    int kind, const char *start, const char *end, Py_ssize_t *consumed)
 {
     Py_ssize_t len = ((char*)end - (char*)start)/kind;
 
     if (translated) {
         /* Newlines are already translated, only search for \n */
-        char *pos = find_control_char(kind, start, end, '\n');
+        const char *pos = find_control_char(kind, start, end, '\n');
         if (pos != NULL)
             return (pos - start)/kind + 1;
         else {
@@ -1687,7 +1687,7 @@
         /* Universal newline search. Find any of \r, \r\n, \n
          * The decoder ensures that \r\n are not split in two pieces
          */
-        char *s = start;
+        const char *s = start;
         for (;;) {
             Py_UCS4 ch;
             /* Fast path for non-control chars. The loop always ends
@@ -1717,21 +1717,21 @@
         /* Assume that readnl is an ASCII character. */
         assert(PyUnicode_KIND(readnl) == PyUnicode_1BYTE_KIND);
         if (readnl_len == 1) {
-            char *pos = find_control_char(kind, start, end, nl[0]);
+            const char *pos = find_control_char(kind, start, end, nl[0]);
             if (pos != NULL)
                 return (pos - start)/kind + 1;
             *consumed = len;
             return -1;
         }
         else {
-            char *s = start;
-            char *e = end - (readnl_len - 1)*kind;
-            char *pos;
+            const char *s = start;
+            const char *e = end - (readnl_len - 1)*kind;
+            const char *pos;
             if (e < s)
                 e = s;
             while (s < e) {
                 Py_ssize_t i;
-                char *pos = find_control_char(kind, s, end, nl[0]);
+                const char *pos = find_control_char(kind, s, end, nl[0]);
                 if (pos == NULL || pos >= e)
                     break;
                 for (i = 1; i < readnl_len; i++) {