Melt the butter in a large skillet and saute the chiles and onions until browned, almost blackened. Add the frozen hash browns, some salt and pepper and toss together. Tip into a buttered baking dish and top with the cheese and bacon. Bake until hot and bubbly, about 30 minutes.