Linux might be the better choice after all.
This library is a KMM (Kotlin Multiplatform Module) which makes it easier to access USB/Serial Ports from Kotlin code. It wraps around the jSerialComm library on desktop, and either jSerialComm or USB ...