First, riders tend to open up and increase power on the upgrades and reduce power but improve aerodynamics on the downhills. Further, most course have substantial flat portions.
I ran this for a 40k TT using 3% slope, 250 watt "average" power (300 watts up, 250 flat, 200 downhill) and a .6 frontal area uphill, .5 on the flat, and .4 downhill and got 40k TT times as follows:
flat course: 3560 seconds
halfup/half down 3715 seconds (less than 3 minutes difference)
half flat 1/4 up and 1/4 down: 3638 seconds (slightly more than a minute difference)
I think the biggest determinant of course differences (for most courses) is how much twisting and turning there is and whether one has to apply brakes. Even if one doesn't have to ever touch the brakes, turning involves acceleration and either requires more energy from the rider to maintain speed or will slow the bike down. If one has to slow down to negotiate a turn this will be an even bigger slowdown.
An original Ironman and the Inventor of PowerCranks