Locking and unlocking the bootloader will wipe userdata
as well, yes.
Mostly because TWRP (so far) has no access to encrypted userdata
, so it’s not really that useful for backups. All the custom ROMs ship their own recovery
, which takes care of your basics like sideloading and wiping data.
You can do “interesting” things with TWRP and adb
. But in the unlikely case you have to, you can just fastboot boot
TWRP, instead of installing it and causing yourself another hurdle for OTA updates.