Shinzo Abe had been Japan’s longest-serving prime minister and remained a force in politics after stepping down in 2020.