The way renaming of datablocks currently works is, to put it mildly, moronic when it comes to using already existing name.
Let’s say you have game engine export pipeline where material names matter so that imported models are correctly matched with existing materials (In other words, UE4 default workflow. Yes, that UE4 which donated 1.2M to BF).
Now, you proceed to create a new material on one of your objects. Having forgotten you already used that material name once, you type it in and… nothing happens, it just works! Then, on some other random object in the scene, one of the material names gets changed from MaterialName to MaterialName.001. Without your knowledge. Without any indication from the Blender to the user that anything like that happened. You then proceed to re-export the models, and notice your material assignment is broken because of this.
There are quite a few ways to handle this:
You can automatically add number increment to the name of datablock that’s being changed, not the other, existing one.
Or you can simply prevent user from entering the name with the tooltip saying the name of same name already exists.
But no, we have to have it the Blender way, where when you type in existing name, Blender quietly, without your knowledge, changes name of something else in the scene, once again working against the user.
One more scratch on a huge blackboard of things that are not considered bugs but cause immense amounts of damage to the user.