If you're ok with FWD, you'd be hard pressed to find a better car than a MK7 GTI with Performance Package (LSD, big brakes, touch more power, etc).
AWD, I'd look at a Golf R.
The problem with Subaru's is the gas mileage. The WRX is rated at 25 highway, and you'd probably have to work at it to get there.
A4 would be a fun car, although 40k for one might be tough.
328i? same problem with a4 though.