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 JWR66Y (4.3) 2013 N7: Stock JSS15R (4.3)
Touchpad: CM10.2 JLS36I (4.3.1) iTouch 5G: Stock 10B146 (6.1.2)