If dwarves are assigned a weapon that they absolutely cannot match their attached weapon with, they'll drop their attached weapon and pick up a new one. So, if you upgrade from, say, bronze axes to steel ones and tell your squad to equip steel axes with exact uniform matches, they'll upgrade. Attachments are only really a problem to get around if you want them to upgrade to a higher-quality weapon of the same type and material.
If you do happen to want them to upgrade to a higher-quality item of the same type and material, what you need to do is mark the attached weapon for dumping and have a garbage dump zone. A civilian will come along, take the weapon, and dump it as normal. The soldier will then pick up the most valuable available item that fits their uniform, which will presumably be the highest-quality one. Therefore, attachments are only really a problem to get around if they've given a name to a weapon you want them to swap off of, since you can't dump named items.
If you happen to want to switch off a named weapon, clear the soldier's uniform entirely and set them to exact matches. They should, eventually, drop the named weapon. Now, forbid the named weapon and reassign the uniform. They'll gear up again, except without choosing the named weapon since it's forbidden.