Buying a ticket at T5 really takes no time at all. There is a NEX office close to the exit from customs (turn left and walk a few yards). There are machines that take credit cards, including Amex. Very easy.
Yes it really does cost £25, which is a rip-off. A cheaper alternative is to catch the bus to Feltham railway station, then take a train to Gatwick, changing at Clapham. Takes a bit longer, though...