It would be possible to create a flow in Shopify Flow App to run, say, each time the product status is changed, loop over all metafields and delete ones which do not have a definition.
This, however, is not really safe – there is a lot if information stored in metafields by Apps, like product review data or Google Shopping product categories, etc.
While these has no definition, deleting them would not be wise.
Also, i doubt having a bunch of extra metafields would really slow down your store (though I have no testing data).
Unless you have hundreds of metafields or some notoriously bad code to loop over all of them each time product card is rendered in collection grid I would not pay much attention to it.