reduce marshal stack size in debug mode on windows (closes #27019)
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index 1967c48..76d59ba 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -234,7 +234,10 @@
         # Create a deeply nested structure.
         head = last = []
         # The max stack depth should match the value in Python/marshal.c.
-        MAX_MARSHAL_STACK_DEPTH = 2000
+        if os.name == 'nt' and hasattr(sys, 'gettotalrefcount'):
+            MAX_MARSHAL_STACK_DEPTH = 1000
+        else:
+            MAX_MARSHAL_STACK_DEPTH = 2000
         for i in range(MAX_MARSHAL_STACK_DEPTH - 2):
             last.append([0])
             last = last[-1]