If you don’t quit blender, there is no obvious reason to do that.
You can remove or mute texture from material, without removing material.
You can also remove material without deleting material slot.
If you have to remove material slots, you can store material index as a Face attribute of mesh with Integer data Type, instead of multiple vertex groups.
If you need to export to another software, you may store equivalent of material index as any kind of attribute supported by it and export format.
“If you have to remove material slots, you can store material index as a Face attribute of mesh with Integer data Type, instead of multiple vertex groups.”
When you assign different materials to to different faces, a material_index attribute is automatically created.
It is automatically removed when you suppress the slots.
You just have to rename it, for example, to mat_index to avoid its deletion ; when you delete the material slots.
Then, when you recreate material slots ; you just have to rename mat_index to material_index to reassign new materials slots to same faces used by old ones.