I wasn't clear in my description. For me, Apple Music always kept on opening whenever I interacted with my headphones, e.g. by clicking on play/plause buttons, at least since macOS 10.5 in 2007. Might just be an issue on my side (doesn't look like it though), but I've been disabling iTunes/Apple Music for years by making it non-executable until Apple introduced System Integrity Protection, making it impossible to modify Apple's apps. And now I just keep NoTunes running. I can live with it eating 8MB of my RAM.