There's no built-in support for dynamic textures at all, but what you can do specifically for wielded items is what the compass mods are doing. See what ccompass does to register all possible variants and update the wielditem accordingly.
A big drawback is that the engine will perform an item switching animation on updates, and this can't be overridden.
Wow, this is *exactly* the solution I came up with last night on my own! But it took me many hours of experimenting to figure out that it's the only way to do this.
It's working great, but I wish there was a way to turn off the switch animation OR dynamically change the wield_image in register_tool.