Simple answer is that the quoted 138hp is a net figure and the 165hp is gross horsepower.
My dport supplement quotes the gross horsepower at 157hp.
Thats still a bit shorter of the 165hp which appears on the yellow sticker in the engine bay of the australian ford uprated Dport cars.
The 157 hp is gross DIN, which is euro metric and the 165 hp is gross SAE and when converted the 157 rounds up to about 160 gross SAE.
Possibilities for the 5 hp discrepancy.
Carby settings for europe a little conservative to allow for emissions control that we in aus didnt have.
In 1972 conversion figuring was done by hand and produced inaccurate results as evidenced in the workshop manuals.
Finally there was "rounding up". Why round down when rounding up produces a better looking number?
So for ballpark numbers,
Oval port = 128 net din.
D port = 138 net din.
D port RS3100 = 148 net din.
As far as i can tell, looking into the actual engine and the dport spec supplement its a standard dport 722F apart from any specific carby tuning for australia.