Bluesnooze[1] mostly resolved this issue for me on MacOS. I also own the XM3s, as well as non-Apple Bluetooth earbuds (Edifier X3), neither of which support multiple devices.
>Bluesnooze prevents your sleeping Mac from connecting to Bluetooth accessories.