Ian McKellen's got a morbid standard for the parts he takes ... picturing his legacy if the next role happened to be his last -- and, admitting there's one film he'd do in a heartbeat.
The actor -- who turned 85 last month -- sat down for an interview with "The Sunday Times" and revealed whenever a script comes in he considers it like it may be the last part he ever plays.
He says those stakes make him turn down many projects ... and push him to be his best version on stage or screen -- 'cause he may not get another shot at it.
That said, IM's totally sure about one role he'd go back to -- the wizard Gandalf in the hit "Lord of the Rings" universe.
There have been rumblings about a new flick starring Gollum -- played by Andy Serkis -- and, Ian says he'd don the hat and beard once more ... if he's still alive, he clarifies.
Worth noting ... McKellen's shooting down rumors he's actually been approached so far -- insisting there's not an offer on the table.
BTW ... former President Donald Trump catches a stray during this interview -- with McKellen saying he watches CNN most nights and thinks 45's one of the worst orators he's ever seen. He calls him an "absolute bewilderment."
So, don't expect McKellen to star in a Donald Trump biopic ... 'cause we're pretty confident he wouldn't want that to be his final role.