My view is that a change from McNulty to McAnulty is not actually a name change but rather a different way of spelling the same name.
It is a good idea to note these variations and when you have a database to check go through the DB trying all the name variations
In days past people were not as literate as they are now, surname spelling was not fixed even within families and people relied on others, like Registrars, to spell their names on official documents.
Then you have the documents coming after emigration where you might have a foreign born emigrant in their capacity as a Registrar or census taker listening to the sound of name of a emigrant from a different country. Say a US person born in Germany recording the census details of an Irish immigrant. Sometimes names were just phonetically.