Temporarily rooting an old 2nd generation Moto G - how can it be done?
If there is a way to "temporary root" your device it can be usually used by any app - unless you are able to fix the used vulnerability on-the-fly (but I think there are only a few people world-wide who could do so). 

IMHO the best way to unlock the bootloader, install LineageOS. Even the nightly releases of Lineage are usually very stable. Lineage is by default not rooted. After installing Lineage you can activate encryption using a long password (have to be entered only at boot). 

A unlocked bootloader is not nice but way more secure than a vulnerable system which can be exploited by any app. An unlocked bootloader at least requires physical access to your device. If your user data is encrypted only the system could be modified. Hence it would be only a problem in the "evil maid" scenario, but not in case of a device loss.