Some things I thought about were:
- Going into offline mode before doing any of the above: but enabling Internet could be done by default after these.
- Installing the NetGuard firewall and configure it to start automatically: but the app could be disabled or take too long to start up. And it doesn't help with factory-resets.
- Going into a remote area where there's no mobile Internet: impractical.
- Somehow encasing or modifying the phone to be able to prevent it from Internet access and going into Offline-mode afterwards: likely impractical.
But I guess the best solution is the following:
After doing this one needs to go into offline mode, disable "synchronization" settings (including in all apps such as messengers) and install the apparently only non-root open source firewall for Android: NetGuard.