Both PyHKEY_New and PyWinObject_CloseHKEY are unused and not exported to the module, so I think we can safely remove them to clean up the codebase. The latter looks like it was intended to be a module-level function exposed to Python, but it hasn’t been exported in recent versions at least.
Activity
gh-140916: Remove unused codes in winreg.c (#140934)
pythongh-140916: Remove unused codes in winreg.c (python#140934)