Spread the dried pinto beans out on a sheet pan or countertop and pick out any small stones or damaged beans. Rinse the beans well under cold water. For faster cooking and creamier beans, soak them overnight in a large bowl covered with water, then drain before cooking.
Add the smoked ham hocks and 6 cups of water or chicken broth to a large Dutch oven or heavy pot. Bring to a boil, then reduce the heat to a simmer. Cover and cook for 45 minutes to 1 hour to pull flavor from the ham hocks.
Add the rinsed pinto beans to the pot along with the onion, garlic, bouillon, smoked paprika, black pepper, garlic powder, onion powder, cayenne, and bay leaf. Add more water or broth if needed so the beans are covered by about 1–2 inches of liquid.
Bring the pot back to a gentle boil, then reduce the heat to low. Cover and simmer for 2 to 3 hours, stirring occasionally, until the beans are tender and the ham hocks are falling apart. Add more hot water or broth as needed if the liquid gets too low.
Remove the ham hocks from the pot and let them cool slightly. Pull the meat from the bones, discard the bones and excess fat, then stir the meat back into the beans.
Mash some of the beans against the side of the pot with a spoon, then stir them back into the broth. Let the beans simmer uncovered for another 15–20 minutes until the broth thickens. Taste and adjust the salt at the end. Finish with butter if desired.
For the cornbread, preheat the oven to 425°F and place a cast iron skillet in the oven while it heats. In a mixing bowl, whisk together the cornmeal, flour, sugar if using, baking powder, and salt. In a separate bowl, mix the buttermilk, eggs, and melted butter.
Pour the wet mixture into the dry mixture and stir just until combined. Carefully remove the hot skillet from the oven, add the bacon grease or oil, and swirl it around the pan. Pour in the batter and bake for 18–22 minutes, or until golden brown and a toothpick comes out clean. Let it rest for 5 minutes before slicing and serving with the beans.