It should be possible, but also keep in mind that there's no hard, standardized layout for their config files. Each launcher could store the widget settings in their own manner and there's many different launchers.
Perhaps you should consider asking your launcher maker to add a setting to automatically remove uninstalled widgets, but from a user perspective your only real choice is to manually remove them.
XDA Wiki Moderator
Nexus 4: Stock KOT49H (4.4.2) 2013 N7: Stock KOT49H (4.4.2)
Touchpad: CM11 KOT49H (4.4.2) iTouch 5G: Stock 10B146 (6.1.2)