seems like an odd place for something that must be updated constantly as USB devices are plugged and unplugged, but if you've confirmed that it really does update in real time, fair enough!
Probably the thing to do in PuTTY is to make each frontend have a flag for "can I get a list of com ports?" and a function to return them if so, and in config.c, make the "Serial line to connect to" ctrl_editbox conditionally become a ctrl_combobox if the answer is yes.
@simontatham searching around different places like stackexchange and other coding places, it seems like the registry path is good, and if your windows verion supports it - https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcommports
The registry is a weird thing, but yes, as i connected my usb-serial adapters, the reg keys are created and removed as i hit F5 while plugging/unplugging.
Gets an array that contains the well-formed COM ports.learn.microsoft.com