Adding on to this line of thinking, maybe a thin plastic tube and epoxy to encase it with the solder joints. (Bonus points for using thermal epoxy, since it is a resistor after all.)
I have seen Bigclive on YouTube encase resistors and a diode rectifier in standard epoxy for use in lighting, so heat probably won’t be an issue now that I think of it.