After some time and several meetings with my mentors, we have a little progress in the topic.
1) Refactoring singleton state.
Move all masters to new API. It includes reducing the of static global variables. More detailed info in the issue tracker.
Merged: atahpt Under review: drkaiser, gfxnvidia
2) Restoring PCI value explicitly.
Programmers can restore a PCI value themselves in shutdown function. More detailed info in the issue tracker.
Under review: atahpt
3) Introducing default shutdown func.
We haven't been coming to any agreement. The best way is to finish refactoring master API first. And after that we'll return to this issue. See the comment thread in the patch for more details.
 https://ticket.coreboot.org/issues/391  https://review.coreboot.org/c/flashrom/+/64963  https://review.coreboot.org/c/flashrom/+/65194  https://review.coreboot.org/c/flashrom/+/65342  https://ticket.coreboot.org/issues/389  https://review.coreboot.org/c/flashrom/+/65386  https://review.coreboot.org/c/flashrom/+/54890