Fix typos mostly in comments, docs and test names (GH-15209)

diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index bd67c6e..85fa799 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -110,7 +110,7 @@
   WinDLL(..., use_last_error=True) swap the system LastError value with the
   ctypes private copy.
 
-  The values are also swapped immeditately before and after ctypes callback
+  The values are also swapped immediately before and after ctypes callback
   functions are called, if the callbacks are constructed using the new
   optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) or
   WINFUNCTYPE(..., use_errno=True).
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index 235a4d7..8709cc5 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -352,7 +352,7 @@
     int big_endian;
 
     /* HACK Alert: I cannot be bothered to fix ctypes.com, so there has to
-       be a way to use the old, broken sematics: _fields_ are not extended
+       be a way to use the old, broken semantics: _fields_ are not extended
        but replaced in subclasses.
 
        XXX Remove this in ctypes 1.0!
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index 793ce92..a5f4c47 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -841,7 +841,7 @@
 
     /* Set carefully the position value. Alternatively, we could use the seek
        method instead of modifying self->pos directly to better protect the
-       object internal state against errneous (or malicious) inputs. */
+       object internal state against erroneous (or malicious) inputs. */
     position_obj = PyTuple_GET_ITEM(state, 1);
     if (!PyLong_Check(position_obj)) {
         PyErr_Format(PyExc_TypeError,
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index 810cad6..3f7afad 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -899,7 +899,7 @@
 
     /* Set carefully the position value. Alternatively, we could use the seek
        method instead of modifying self->pos directly to better protect the
-       object internal state against errneous (or malicious) inputs. */
+       object internal state against erroneous (or malicious) inputs. */
     position_obj = PyTuple_GET_ITEM(state, 2);
     if (!PyLong_Check(position_obj)) {
         PyErr_Format(PyExc_TypeError,
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index cc3b089..640ec59 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -4634,7 +4634,7 @@
     /* Initialize reference count to avoid early crash in ceval or GC */
     Py_REFCNT(op) = 1;
     /* ob_type field is after the memory block: part of "forbidden bytes"
-       when using debug hooks on memory allocatrs! */
+       when using debug hooks on memory allocators! */
     return test_pyobject_is_freed("check_pyobject_forbidden_bytes_is_freed", op);
 }
 
diff --git a/Modules/expat/loadlibrary.c b/Modules/expat/loadlibrary.c
index 35fdf98..2f80b3a 100644
--- a/Modules/expat/loadlibrary.c
+++ b/Modules/expat/loadlibrary.c
@@ -53,12 +53,12 @@
 /* See function definitions in winbase.h */
 #ifdef UNICODE
 #  ifdef _WIN32_WCE
-#    define LOADLIBARYEX  L"LoadLibraryExW"
+#    define LOADLIBRARYEX  L"LoadLibraryExW"
 #  else
-#    define LOADLIBARYEX  "LoadLibraryExW"
+#    define LOADLIBRARYEX  "LoadLibraryExW"
 #  endif
 #else
-#  define LOADLIBARYEX    "LoadLibraryExA"
+#  define LOADLIBRARYEX    "LoadLibraryExA"
 #endif
 
 
@@ -88,7 +88,7 @@
 
   /* Attempt to find LoadLibraryEx() which is only available on Windows 2000
      and above */
-  pLoadLibraryEx = (LOADLIBRARYEX_FN) GetProcAddress(hKernel32, LOADLIBARYEX);
+  pLoadLibraryEx = (LOADLIBRARYEX_FN) GetProcAddress(hKernel32, LOADLIBRARYEX);
 
   /* Detect if there's already a path in the filename and load the library if
      there is. Note: Both back slashes and forward slashes have been supported
diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c
index 9c0987f..311dbc4 100644
--- a/Modules/expat/xmlparse.c
+++ b/Modules/expat/xmlparse.c
@@ -3399,7 +3399,7 @@
            * has to have passed through the hash table lookup once
            * already.  That implies that an entry for it already
            * exists, so the lookup above will return a pointer to
-           * already allocated memory.  There is no opportunaity for
+           * already allocated memory.  There is no opportunity for
            * the allocator to fail, so the condition above cannot be
            * fulfilled.
            *
diff --git a/Modules/termios.c b/Modules/termios.c
index 7601b68..aee7f12 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -18,7 +18,7 @@
 #include <sys/ioctl.h>
 
 /* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR,
- * MDTR, MRI, and MRTS (appearantly used internally by some things
+ * MDTR, MRI, and MRTS (apparently used internally by some things
  * defined as macros; these are not used here directly).
  */
 #ifdef HAVE_SYS_MODEM_H