you don't need to pedal slower - just pedal softer. Take the weight off the pedalstroke to ease the tension on the chain before you shift. It's called "unweighting" the pedals.
you can also use the same technique when pedalling during a descent. You don't need to add tension to the chain but you can still soft pedal. Also keeps your cadence up for when you hit the bottom of that hill.
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, champagne in one hand, strawberries in the other, body thoroughly used up, totally worn out and screaming: "Yeah Baby! What a Ride!"