previous owner not smart. removing cured insulation foam
As others have said it looks like bondo. If you don't want a dusty mess maybe a needle scaler would work well? I would try it on a scrap piece of sheet metal first to make sure you're not going to damage the firewall.