Square and Cash App operator Block said it would slash nearly half its workforce as AI reshapes its business, fanning fears of mass layoffs to come.