How do I make a BLE connection to a peripheral with Kotlin Multiplatform or native Android?

Working with BLE through the Android SDK causes a lot of pain. I would like someone to help me with a good implementation of BLE connectivity. Also, it would be nice if this code was also available on other platforms via KMP.