Toronto was desperate for a defensive specialist. It's worth the risk. Tanev's game doesn't rely on speed or physicality which are usually what diminish with age. The only real downside is it's relatively buyout proof. But 4.5M in 4-5 years won't seem that big a deal even if he becomes more of a 4th defensemen by that point.
Realistically on a contender he is a 4th D-man at this point. He will start his 5th year at age 38 and turn 39 3 months in. Not many D-men can still be a top 4 d-man at that point. Here are the list of D-men who played at age 39 last season. (ages below are last year ages)
Mark Giordano - Age 40 status Cooked
Ryan Suter - started season at age 38 turned 39 mid season - bought out by Dallas at end of season ( signed to league min contract with the Blues) Cooked
Brent Burns - started season at age 38 turned 39 mid season - Still effective as a top 4 PP
Alex Goligoski Age 38 - pretty much cooked (no contract this yr)
Thats it, that is the list of guys who played as a 38 yr old or older at some point last year.
The 37 yr olds
Jack Johnson - played for league min last year with Avs (still effective in a bottom pair role) with columbus on league min this yr
Marc Staal Played 35 games with Philly last year. Status done - retired
The back end of that contract will be ugly, only 6 guys played last year at the age he will be in year 4 of his contract, only one Brent Burns was still a top 4 D man.