Do not open Apple Music when pressing a media key
This still works under Big Sur on M1 Macs:
launchctl bootout &quot;gui/$(id -u &quot;${USER}&quot;)/com.apple.rcd&quot;
launchctl disable &quot;gui/$(id -u &quot;${USER}&quot;)/com.apple.rcd&quot;

The top command disables it immediately. The bottom command prevents it from reactivating on restart.
To return to the default behaviour, replace bootout with bootstrap and disable with enable:
launchctl bootstrap &quot;gui/$(id -u &quot;${USER}&quot;)/com.apple.rcd&quot;
launchctl enable &quot;gui/$(id -u &quot;${USER}&quot;)/com.apple.rcd&quot;

Note this may disable the media keys for other apps as well.