Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246)

Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles.

See for example GH-13135
diff --git a/Lib/enum.py b/Lib/enum.py
index 8a6e5d2..06f42a9 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -420,7 +420,7 @@
         if module is None:
             try:
                 module = sys._getframe(2).f_globals['__name__']
-            except (AttributeError, ValueError, KeyError) as exc:
+            except (AttributeError, ValueError, KeyError):
                 pass
         if module is None:
             _make_class_unpicklable(enum_class)