MacOS - Manually open as read only
You can do this in Finder with a simple keystroke and one click.
Before opening your file do this:

Select the file in Finder
Press Command-I (this is the same as Get Info in the File menu)
Tick the box next to Lock in the General section.

This sets the immutable bit - meaning you can't change the file in any way.
Leave the Get Info window open and, when you are finished, untick the Lock box to unlock the file.
You can create Services (or Quick Actions) to lock and unlock files, and associate a keystroke with them, but I feel is hardly with the effort.  If you want to create them, run Automator and create a new Quick Action.  This is what you need:

Save it with the name Lock.
Modify by changing the uchg to nouchg and save as Lock Off.
Now these appear as Services and in Finder's Quick Action submenu.
You can also associate them with keystrokes in System Preferences - Keyboard - Shortcuts - Services. I chose the keystroke combinations Control Command L and Shift Control Command L.