I wonder if it is programmatically possible to assign any icon to a given skill in the quickbars.

The underlying idea would be to make an UI where every spell that removes poison has the same icon, for every class. Every big heal that takes a long cast time has the same icon, for every class. Every dot spell, etc... you get the picture.

A sub-idea would be to change the two-skills gambit builder to the icon of the skill they enable, rather than their pretty neutral-illegible (yes that's a new AD&D alignment) current design.

Should someone confirm it is indeed possible, I'll have to bend my head to yet another crazy environment and do it.

You could maybe have a custom bar that would have those features. You will not be able to change icons on the existing bars. And that second things also means your custom bars will not have keybinds. So some part of it is doable, but probably not in a way as cool as you describe it.