Just in case your friend misses the last THSR train, the highway buses run around the clock. There are many bus operators, but I have always used Ubus when going south of Taoyuan. The ticket counter will sell you a two part ticket: Route 1627 Taoyuan Airport to Zhongli rest area, and Route 1611 Zhongli rest area to Tainan. The fare will be about NT$400. The buses run every 30 to 60 minutes. If you leave the airport at midnight, you might get to Tainan by 4 AM.
To elaborate the previous comment on safety. The onboard safety is fine. Mind your personal belonging and you will be fine. Road safety is usually no problem, but there have been high profile accidents involving tour buses caused by equipment malfunction or driver fatigue.