How to temporarily change field property in python

How to temporarily change field property in python?
I want to another doctype’s field ‘set_only_once’ property to false and after some changes set it back to true. How can this be achieved?

It’s a bad practice, why you want to do so? Instead you should disable set_only_once altogether and validate the data via python function where it is required.