Hi and welcome
Is your piggy underweight or a hairless breed? Your title does not make that clear! Hairless skinnies (the breed) have a much faster metabolism, need to eat more (and as a result are pooping machines) and have a sightly shorter life span due to living on fast forward. A 6 year old skinny would be a VERY old one indeed!
Small poops mean a decreased food intake; please offer your boy syringe feed top and weigh daily at the same time so you get an idea of how much you offer and whether it is enough. Unlimited hay is making over 80% of the daily food intake, but it is generally the first food group impacted when your piggy is not feeling well. You cannot control hay intake by eye. Your care at home can make a real difference in quality of life and supporting your piggy through an illness - and sometimes make all the difference between life and death until medication can kick in!
Impaction - How To Help Your Guinea Pig.
6 years is right in the middle of the average life span of hairy piggies. How piggy savvy is your vet? Weight loss can have many reasons, usually caused by either a pain/discomfort issue or by an obstruction or problems with processing the nutrients, internal growths etc. Ask your vet to check for arthritis, organ problems (especially kidneys or heart; the others are much harder to diagnose).
Also check elderly boars for impaction. Some problems can be hard to find, but it is very good that you have already got an appointment booked.
Impaction - How To Help Your Guinea Pig.