You should take a look at Function Flip. It can selectively toggle function keys between being regular function keys or the special hardware keys, including the media keys (F7, F8, and F9). Essentially, it does the same thing as "Use all F1, F2, etc. keys as standard function keys" setting (System Preferences > Keyboard), except only to individual function keys instead of all of them.
Best Answer
I found the solution here: https://www.makeuseof.com/tag/remap-macs-function-keys-anything-want/
/10char