my cat refuses most of the food; lost weight
a) Tooth loss: Painful in and of itself. Chewing anything will be an agony. You can do nothing about it at this point.
b) Severe weight-loss (Catabolisim): Nerve pain, tremors, muscle pain. Short of force-feeding, there is nothing you can do about this, either.
17 years is a very good run for a cat that has had sketchy vet services, and a moderate run for a cat that has had excellent care-and-feeding. You have no guilt here, at all. Give the cat a soft landing, mourn his passing, and move on. He will thank you for it!