This may be more involved than what you are looking for, but you can create a Shortcut that will pause music from playing anytime a bluetooth device, or specifically your AirPods, are connected.
- Open Shortcuts app
- Tap "Automation" at the bottom center of the screen
- Tap "Create Personal Automation"
- Tap "Bluetooth"
- Tap "Choose" under Device and if your AirPods are connected you can choose them or "Any Device" which would also stop Music from playing whenever a bluetooth device is connected, such as a speaker or your car.
- Tap "Done"
- Tap "Next"
- Tap "Add Action"
- Tap "Media"
- Scroll down to the "Playback" section and tap "Play/Pause"
- Tap "Play/Pause" on the top of this screen and choose "Pause"
- Tap "Next"
- Tap "Done"
That should do it. If it does not work it can be easily deleted by swiping left like normal on the newly created shortcut. If you go this route, please respond if it works for you as desired.