Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter.

I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag).
diff --git a/Modules/_struct.c b/Modules/_struct.c
index edbe9b9..3f20518 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1184,7 +1184,7 @@
     size = 0;
     len = 0;
     while ((c = *s++) != '\0') {
-        if (isspace(Py_CHARMASK(c)))
+        if (Py_ISSPACE(Py_CHARMASK(c)))
             continue;
         if ('0' <= c && c <= '9') {
             num = c - '0';
@@ -1249,7 +1249,7 @@
     s = fmt;
     size = 0;
     while ((c = *s++) != '\0') {
-        if (isspace(Py_CHARMASK(c)))
+        if (Py_ISSPACE(Py_CHARMASK(c)))
             continue;
         if ('0' <= c && c <= '9') {
             num = c - '0';
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 19681b4..74db739 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -1099,7 +1099,7 @@
 static int
 to_int(int c)
 {
-    if (isdigit(c))
+    if (Py_ISDIGIT(c))
         return c - '0';
     else {
         if (Py_ISUPPER(c))
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 4179c0e..67bff25 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -695,7 +695,7 @@
     if (strlen(msgbuf) > 0) { /* If Non-Empty Msg, Trim CRLF */
         char *lastc = &msgbuf[ strlen(msgbuf)-1 ];
 
-        while (lastc > msgbuf && isspace(Py_CHARMASK(*lastc)))
+        while (lastc > msgbuf && Py_ISSPACE(Py_CHARMASK(*lastc)))
             *lastc-- = '\0'; /* Trim Trailing Whitespace (CRLF) */
     }
 
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index bc3372f..e027625 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -519,7 +519,7 @@
                 /* If non-empty msg, trim CRLF */
                 char *lastc = &outbuf[ strlen(outbuf)-1 ];
                 while (lastc > outbuf &&
-                       isspace(Py_CHARMASK(*lastc))) {
+                       Py_ISSPACE(Py_CHARMASK(*lastc))) {
                     /* Trim trailing whitespace (CRLF) */
                     *lastc-- = '\0';
                 }