Can I force a "no-changes rebase" without a rerere history DB?<sub>(a variation on on @j6t 's suggestion:)</sub>
You can use the commit editing feature of [`git-filter-repo`]. This tool is generally interesting for applying callback-based or analysis-based transformations on git repositories, but the specific capability you would likely use is the ability to run a given Python script on each commit:
$ cd /path/to/repository
$ git-filter-repo --commit-callback 'SCRIPT BODY HERE'
Now, when the script is run, an object named `commit` will be defined. This object has, among others, the fields `commit.original_id` holding the hash, and `commit.message` holding the commit message. Thus your script might be something like:
commit.message.replace(b"Hello world", b"Goodbye world")
You can also look at [a few more examples] of git-filter-repo scripts.
Caveat: Haven't tried this myself yet.