There might be an easier way but it varies between PC makers.
Press the Windows key & the X key. This will open the Windows Mobility Center - a utility that you will find has been customised by HP.
They might have provided an entry for "Function key behaviour" that allows you to switch between "Multi-media keys" & "Functions keys". You could then normally have the benefit of quick access to the multi-media uses of these keys but deliberately switch
this off when you want to use those applications for which it proves awkward.
Similarly, while the keys are set as multi-media keys you should be able to press the Fn key with the F1-12 key to get it to operate as a normal F1-12 key. And when they are all set to be normal F1-12 function keys, you could press Fn with the F1-12 key
to get them to operate as multi-media keys. *In other words, using the Fn key with the Function key reverses whatever is set up as its normal behaviour.*Again, this varies with PC makers but is a fairly common capability so try it to see if it applies
to your PC.