Power from 24VAC

How about a Murata OKI-78SR-5/1.5-W36-C? The ebay one linked to looks like a clone of the Murata. The Murata is only $5, max Vin is 36V though so you could drop your 40V with a resistor between your bridge and the power supply. Dropping voltage from an unregulated transformer shouldn't be dramatic, it won't take much resistance (and thus wattage) to get a lot of voltage drop.