Starbucks reported strong earnings in its fourth quarter as consumers spent more on its beverages despite surging inflation.