How to detect which extras were installed at runtime?

FYI, this was discussed at the PyCon Packaging Summit 2022 and further progress has been made; see: