2In a large bowl, whisk together the flour, baking powder, salt, and baking soda. Stir in the chopped ham, scallions if using, thyme, and 1¾ cups (7 ounces) of the Gruyère (reserving the rest for topping). In a separate bowl, whisk together the melted butter, eggs, and buttermilk. Add the wet mixture to the flour mixture and stir to combine. The batter will be thick.
3Transfer the batter to the prepared loaf pan and spread it out evenly, smoothing the top. Sprinkle the remaining ¼ cup (1 ounce) cheese over the top. Bake until the top springs back when lightly pressed and a skewer inserted in the center comes out with some moist crumbs attached, 45 to 55 minutes.