5 years doesn't bother me in the slightest bit. Anybody worrying that this means he's going to bolt once he hits UFA status needs to take a chill pill. I've said this before but 5 years is an incredibly common term for superstar players to take after their ELCs. Kane, Toews, Malkin, Benn, Crosby, Stamkos, Getzlaf, and Perry all went that route and they all re-signed with their teams. As long as the Leafs are still competitive after the contract, there's literally zero reason to think that he'll bolt.
If that cap hit is accurate, well it's slightly more than I would have liked at 5 years but at the end of the day Matthews is a top-10 player in the league and rules about RFA discounts or buying UFA years don't really apply to him. He gets what he deserves regardless of those things.