Revert "Used `const` for a constant function".

This was discussed in the github comments for this commit.

This reverts commit 4ffe110bd1feca26f2f38ad7f2c301e631aaf808.