You simply calculate the elevation difference on each hole and add them up. One of the courses I have lots of quality stats on is Granite Ridge at Highbridge. Even though it starts and ends at the top of the hill, there are 11 downhill holes, 4 uphill and 3 essentially level. That's because several holes have uphill walks from the pin to the next tee as you suggest.
Rater of the Tossed Arc