Disabling the Chromecast button didn't help at all. After my battery had been drained to around 35% in about 5 hours of playing music (and phone was warm too), I tried disabling autoscan as well and it didn't seem to help initially - I did not stop playing music when I changed the autoscan setting. After I stopped playing music for some time, I started again and battery didn't seem to be draining as fast and phone wasn't getting warm either. I'm not 100% sure that disabling autoscan fixed it for me, but it seems better so far. I'll have to test it some more. And I do not have keep notification or keep service setting on.
I also have noticed that Poweramp has been draining my battery and making my phone very warm for the past few weeks. I used to be able to listen to music at work all day and still have 70-80% battery left. If I try that now, my phone gets very warm and I'd be left with maybe 30% at end of the work day (if I let it play the whole time). I am currently using a Oneplus 5T with OxygenOS 9.0.5. I encode my music to FLAC and I have all Poweramp receivers disabled. I'm using Poweramp build 826. I play my music through 3.5mm earphones. The screen is usually off while music is playing, with a mix of Poweramp being open in the foreground and in the background. After reading through this thread, I've just disabled that Chromecast button setting and will see if that makes a difference.