In a large bowl, combine the mashed potatoes, flour, baking powder, salt, and black pepper. Mix until a dough forms.
If using, fold in the chopped green onions and shredded cheese until evenly distributed.
Turn the dough out onto a floured surface. Divide it into 8 equal portions and shape each portion into a patty, about 1/2 inch thick.
Dust the patties lightly with flour to prevent sticking.
Heat a large skillet over medium heat and add the butter. Once melted and bubbling, add the potato cakes to the skillet in batches, being careful not to overcrowd.
Cook for about 4-5 minutes on each side or until golden brown and crispy.
Remove the cakes from the skillet and place them on a paper towel-lined plate to absorb excess grease.
Serve warm.