Yes, this is called Bluetooth multipoint and has been common on non-Apple devices (for example Bose) for a few years now. Requires no logins and is vendor-agnostic.
I can stop music on my phone and immediately listen to music from my laptop. I have non-apple headphones, a non-apple laptop and an iPhone. There is no apple magic dust that makes this happen.
It doesn’t need “the cloud” (switching works offline) but it does need to verify that the device it’s switching to belongs to you, which it does using a keypair associated with your account.