Companies like Kroger, Walmart and McDonald’s are getting caught in the political messaging around inflation ahead of the 2024 election.