Setting PYTHONMALLOC helped me locate an earlier bug. It seems to me
that there aren't big downsides to always setting this during testing,
and it might help find other bugs in the future.
# tests.
setenv TERM "dumb"
+ # This setting helps detect bugs in the Python code and doesn't
+ # seem to have a significant downside for the tests.
+ setenv PYTHONMALLOC malloc_debug
+
# If DEBUGINFOD_URLS is set, gdb will try to download sources and
# debug info for f.i. system libraries. Prevent this.
if { [is_remote host] } {