Normally, shops or contractors will have the lengths they need, on hand. The vast majority of the time when we cut studs, it's because of a mistake - such as having studs for 3" Class 300 flanges show up, instead of for 4" Class 300, or some surpise maintenance situation.
When I see studs that looking a "little short", it's a situation like the crew didn't have the 4-1/2" long studs they needed for the 4" Cl 300, but they had some 4-1/4" (for 3" Cl 300) in the shop or truck - "We'll use them up." Or somebody just grabbed the wrong ones on the way out the door - it's pretty easy to do.
The supplyhouse we normally use will routinely ship us flanges "dressed" - whatever gasket we call for, B7 studs & 2H nuts - when we ask for it. We don't have to tell them the number, diamteter or length of studs. They don't cut them either - the various standard diameter & length combo's are on the shelf.
There are always exceptions to any given rule, but under normal conditions, why would anybody spend the time to spec studs shorter (or longer) than an industry standard length? And using standard lengths eliminates the "how many threads past the nut" discussions like this. You'll be left with 2 or 3 threads showing, so it'll meet B31.1 or B31.3 and the inspector can see that from a distance.