Taking the death date into account is literally already how prevailing copyright law works. You can just make it conditional on publish date.
Expect something similar when the next big author dies; my prediction: JK Rowling.
Notes:
0 - https://www.congress.gov/bill/105th-congress/senate-bill/505
1- https://hughstephensblog.net/2023/12/18/winnie-the-poohs-cop...