A user.js file should do the thing. It doesn't exactly lock the variable but rather the browser sets it on each launch, so even if it was overridden by an update, it would be overridden by the file again afterwards.
You should be able to achieve that by creating an appropriate policies.json file.
If they knew how to do that they wouldnt be here. https://www.codeproject.com/Tips/5356799/How-to-Place-Mozilla-Firefox-Browser-under-Lockdow
Thank you. I wasn't aware of this problem, and I too wouldn't have found this by myself.
This explains a few things I've been experiencing. How annoying that it's needed.
I can't write code, but this looks pretty easy to follow.
You can put the setting in user.js file. For example, check arkenfox.
I can't help you with Firefox being a moving target, but this is exactly why i use mullvad browser now. All the settings at my preferred paranoia level out of the box
Firefox
A place to discuss the news and latest developments on the open-source browser Firefox