Issue #16847: Fixed improper use of _PyUnicode_CheckConsistency() in
non-pydebug builds. Several extension modules now compile cleanly when
assert()s are enabled in standard builds (-DDEBUG flag).
diff --git a/Modules/_json.c b/Modules/_json.c
index 5b42f6f..db45c28 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -246,7 +246,9 @@
         }
     }
     output[chars++] = '"';
+#ifdef Py_DEBUG
     assert(_PyUnicode_CheckConsistency(rval, 1));
+#endif
     return rval;
 }