I appreciate the explanation but I think the ratio is off because 165X38 shock is 100 mm on most bikes so taking the trunnion in consideration 140 trunnion should be about 105 , the 142.5 should be about 112 and the 145 should be about 120. Maybe the stroke changes that slightly but unless you're compressing the shock to get in the frame then the numbers are still skewed. Not to mention that if it doesn't have capability to full compress the shock and bottom out then what's the point?
I'm not quite sure if I fully understand what you mean... But there seem to be some errors in your thinking. Please correct me if I'm wrong:
You say that "165x38 shock is 100mm on most bikes", do you mean that a frame with a 165x38 shock usually provides 100mm of travel? Well it may be, that many bikes with these shock dimensions have 100mm of travel. But the amount of travel that the shock stroke translates to, depends on the leverage ratio of the frame. And that cannot be "off", it is what it is. Every bike is different. That just depends on how the linkage is designed. Like some bikes with a 210x55 shock have 140mm of travel, others have 160mm.
The Ican here for example has an average leverage ratio of 2,5. That means that for every 1mm of shock compression, the rear wheel moves upwards by 2,5mm - on average. It's probably a progressive frame, so the leverage ratio will reduce throughout the travel.
Now for this, the only important number is the stroke length of the shock, which is the second number, like "38". The first number - 165 - is the eye to eye, so the overall length of the shock. That should usually not be messed with, since any changes will drastically affect the geometry of the bike. Also, it doesn't matter if its trunnion or standard mount. The eye to eye is what counts. In this bike, you should only run 165mm, trunnion or standard.
What the guys are talking about, is keeping the eye to eye length the same, but changing the stroke length of the shock. So when the standard shock would be fully compressed, a longer stroke shock still has some more to go, resulting in more travel. The limit of this is reached when the seat stays hit the seat tube. What Ben did, is go to this point of maximum compression and measure the remaining eye to eye distance, which is 115mm. A 165mm shock would need to be compressed by 50 mm to get to this point. But you need some safety room to avoid breaking the frame at the first bottom out, also because the bottom out bumpers of the shock still give way a little when it's compressed hard. That's why Ben suggested a 45mm stroke shock may work.
The rest is math. Let's say the leverage ratio is 2,5 at the end of the stroke (it's probably a little lower), then an additional 2,5 mm of shock stroke will give you 6,25mm more travel. Take that twice and you have your 112mm with a 45mm stroke instead of the standard 100mm with a 40mm stroke.
Sorry, a lot to read, I know... I hope I didn't misunderstand you, just thought this might help. Took me a while to get behind this linkage stuff too.