Hi and welcome
It is not the painkillers that cause salivation but the symptom can signal a difficulty to swallow of some sort, broken or overgrown teeth or a blockage somewhere in the digestive system between the mouth and the anus. Have you checked his teeth? Are the incisors broken? Is his jawbone OK?
Excessive salivation can also be - combinated with apathy and hot weather - a symptom of a heat stroke.
Please switch from weighing once weekly on your normal kitchen scales to weighing daily first thing in the morning for best day to day comparison. Keep in mind that over three quarters of what a guinea pig eats in a day is hay/grass fibre and that you cannot control this by eye. Any veg, pellets and treats all together only replace the supplementary role that wild forage used to have.
If he is unable to pick up and eat hay well as a result of his accident and is losing weight, then please step in with feeding support promptly.
How to Improvise Feeding Support in an Emergency
Weight Loss Explained: BMI, Weighing, Poos and Feeding Support
I would also check him for mange mites if he keeps biting his back so badly (especially if there are bald patches or open sores there).
New piggy problems: URI - ringworm - skin parasites