STYLE Enable ruff TCH for pandas/core/util/*
ref #51740 

This PR will enable ruff TCH for `pandas/core/util/*` and fix associated issues
thanks - can you run `pre-commit run --all-files` please? I ran `pre-commit run ruff --all-files` and it did pass the check. But since this also happened yesterday I have to rely on the CI... given that it modified files, I doubt it worked yesterday

anyone, should be good, thanks