First, sorry you are going through this.
I do have a concern with something you said though. You mentioned "dementia." If the dementia is making him incompetent to make decisions about his care is it possible he would change his mind if the deentia was treated first? Or is it a side efect of not eating?
I get that he may have just had enough and is ready to go and respect that choice, I'd just want to know it is his real choice and not just the dementia talking, or he just wants out of pain and might want to fight if the pain was gone.
Also, can his dentist refit his dentures so that eating could be easier and less a challenge, thining that every little bit more he eats will encourage him to eat more. Food might have just lost it's taste too. When my grandfather was going through chemo he couldn't taste anything and would eat a few bites of anything but never finished because "everything taated like mud."
I can't encourage you to give him your drugs but if you are considering it the way I would do it is let him know what they are and how strong it is and it might kill him and then just leave it where he can find. Don't hand dose him yourself or even hand him the drugs. IF he has been warned against taking them and then takes them himself I THINK you would be in a much safer legal state.
Clearly I hope he can recover and squeeze some more happiness from whatever time he may have left.