Disable implicit variable updates

As discussed here the variables of the process get automatically updated in the database even if we have not called setVariable() method.

We have a frequent use case where we end up doing small manipulations to the variable’s value(a map) but don’t intend to persist the updates. Is there a way to disable the behavior until someone explicitly calls setVariable() method?

A trivial solution would be to create a copy of the map and manipulate it. But I assume this is not what you want. Besides, the map could contain some objects and if you manipulate them then they’d be saved without you wanting it.