@temporarium
1- The unlock procedure is easy and free via official website however the consequences are pretty bad. Unlocking the boot-loader will
permanently remove the TA partition on the phone which contains the drm keys files and mess up the camera and many other functions will stop working ,these issues can be temporary patched/fixed by using a custom kernel with drm fix support, if you have no idea about DRM keys, read this quote ..
If you unlocked the bootloader on a Sony Xperia device, you probably know that the potential loss of warranty is not the only disadvantage you have to accept. Another fairly hidden issue is related to various proprietary features such as the X-Reality color management, BIONZ image processor and the active noise cancelling techniques. Once you decide to unlock your bootloader, the process also removes a piece of data referred to as the DRM keys. These are tied to various services (such as streaming video and the like) offered by Sony but are also required for the features mentioned above to work properly. Put simply, once the keys are gone, you’ll face issues such as decreased low light camera image quality and the lack of the X-Reality mode.
Note that on older devices shipped with MM or older Android versions like Xperia XZ there's a hack/exploit that was used to backup that TA partition before unlocking the bootlodaer to restore it later whener there's need to but unfortunately this is not possible since XZ Premium (shipped with Android Nougat)
2- For the developer community for Xperia Phones it really depends on the device popularity for example
Z1,
Z3,
Z5 and
XZ premium were quite popular in the last few years and were lucky to have a decent dev community, unlike for example the forgotten
XZs, in my personal opinion I see that the devcommunity for Sony devices is way worse compared to other oems for example (samsung, oneplus, htc ...)