if you have extra headspace to fill (3 gallons of liquid into a 5 gallon keg), you then also have to produce enough CO2 to fill that space with the right amount of pressure, so it would take more sugar. because now you are trying to carbonate the beer, AND fill 2 gallons worth of space with ~10 PSI.
i dont know of any calulator that would do partial keg calculations, taking empty space into account. you could do the math though...
if 4oz of priming sugar = say, 2 volumes of dissolved CO2. convert volumes of CO2 to grams, and that would tell you how many grams of CO2 4oz of sugar produces.
then you would need to figure out how many grams of gaseous CO2 in 2 gallons of space = the pressure you want, and then add the amount of sugar to get that pressure, plus the amount of sugar you would normally add to 3 gallons.
you could just use the regular amount of priming sugar and when its done, just put the keg on the proper PSI setting and let it go the rest of the way like that.