There are some caveats that make it hard to actually pull off.
The player needs to be younger than 35 when the contract is signed. The lowest year (in salary) can't be less than 40% of the highest year, and each year can't be more than 25% less than the previous year. (I think)
It doesn't make alot of sense for players who will get paid alot (otherwise they're walking away from too much in the later years,) or who can realistically get another contract.
Tavares' current contract wouldn't work, but his next would (hypothetically.)
In the case of Tanev, they could sign him to something like 7x4M (cap hit), and then pay him something like 5.5/5.5/5/3.75/3/2.2/2.2. (give or take) He could walk away from the last 2-3 years and retire but he's still leaving money behind.
I doubt it happens and I might be totally wrong based on how signing bonus is factored in.