I have this patch around for some time now.
Using globby is a little slower than on main, but we get to simplify the script a lot.
So, apart from adding a couple of command line options, and not writing the files back to disk if they are changed, this changes the logic of the script: we only replace the version in the files we have in the glob and not all file types.
I could split the patches but I thought it might make sense to make all the changes in the same PR.
Please check the individual commits in case I missed something.
If merged, I will backport it to v4-dev.