I've worked this one out before. Well, almost. I'll spoiler anyway even though I answer a slightly different question (worst case time for the standard BMU bot ignoring Duchies to get to 4 Provinces)
If I remember correctly, it's 35 to get to 4 Provinces, assuming we follow the standard procedure of buying a Province iff total coin in deck >=17. Obviously, the idea is we hit 5 as often as possible, wasting as much money as possible. However, once we get 5 Silver we can do even better, massively overkilling on some Provinces and getting three Provinces ASAP.
However, there are two problems here. Firstly, if we're going for worst case time, we WON'T pick up those early Provinces, because we know they'll clog our deck up too much. So we make our deck better instead, which means Golds over Provinces and generally setting a higher bar before we start greening. Secondly, we're aiming for 8 Provinces not 4, but again, that just means we set a higher bar before starting.
Actually doing the maths and working out the exact optimum point to switch from Golds to Provinces will be tricky, as we have to bear in mind all kinds of annoying 'worst case' tricks (like, having to buy Golds for $13 switches into missing Provinces and buying Golds with $7)
And considering this, I think Kirian is right. It's almost certainly at least 40 turns, probably even more than that.