Mindfire
Istar
The mentor dying, doesn't have to be literally dying. It's figurative and they just have to be removed from the equation so they can not help the protagonist in time or at all. Doing this sets up the protagonist so they have to succeed without a safety net, where the protagonist's failure is the failure of everything. Where's the tension if the protagonist fails and then the mentor just steps in and saves the day? The story might as well have been about the mentor instead of the student because for all intents and purposes the protagonist didn't matter.
That's sort of what I meant. For the purposes of the story, mentor death is kind of inevitable.