So, there are definitely cases where bidding 40 is optimal. There are also cases where bidding 0 is optimal (when your opponent got the Province and you can pileout the next turn). BM wants to bid 17, and engines usually a bit less (generally speaking, the more megaturn-y the engine, the less you bid).
But are there any cases where a bid in the 20s and 30s is optimal?