bpo-36869: fix warning of unused variables (GH-13182)

diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 9b5c0a3..c8c88d2 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -459,6 +459,7 @@
 int
 _PyDict_CheckConsistency(PyObject *op, int check_content)
 {
+#ifndef NDEBUG
     _PyObject_ASSERT(op, PyDict_Check(op));
     PyDictObject *mp = (PyDictObject *)op;
 
@@ -517,7 +518,7 @@
             }
         }
     }
-
+#endif
     return 1;
 }