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 4.4.4 (KTU84P) 2013 N7: Stock 4.4.4 (KTU84P)
iTouch 5G: 6.1.2 (10B146) Surface Pro 2: Win8.1u1 (6.3.9600.17085.amd64fre.winblue_gdr.140330-1035)