You cannot change any commit at all—so, no, there is no way to do this.
On the other hand, there's no requirement that you keep using those original commits. Suppose you had your Git take each commit and copy it to a new-and-improved (but different) commit, with a different hash ID, such that the new-and-improved commits have the adjusted file contents?
This new Git repository would be incompatible with the old one. That means any clones of the old repository are also incompatible with the new one. Everyone who has such a clone must throw it out and start over with the new repository.
This—replacing the old repository with a new-and-improved one, where all commits have new and different hash IDs—is what you can do. As for how you can do it, there are lots of ways: Git is a set of tools (like a machine shop) that you can use any way you like. As for whether it's a good idea, well, that part is up to you.
Here is a clickable Google search link with tool hints.