A potential solution is to create a user who has no or limited write access, and modify up so that it always switches to that user.
I wonder if there’s a way to do this without requiring the creation of a new system user. Some way to revoke all write access for the current process.