Hotels in Shilin (士林) district of Taipei may be fine. Inside the Shilin district, Tianmu (天母) area is more peaceful, while other areas may be interesting. [More caution will be needed around Shilin Night Market since it is a typical place full of tourists and is easy to become a target.]
Basically, hotels located along the Red Line of MRT will be nice choices too. Then you may take MRT to Shilin and then transfer to the university (see Transportation).
You may also find hotels on https://www.travel.taipei/en/accommodation