Melt butter in the bottom of a 5- to 6-quart saucepan or Dutch oven over medium heat.
Add the onions, toss to coat them in butter and cover the pot.
Reduce the heat to medium-low and let them slowly steep for 15 minutes.
Uncover the pot, raise the heat slightly and stir in salt.
Cook onions, stirring every 5 minutes for about 40 to 90 minutes longer until they are an even, deep golden brown.
Add sherry or vermouth, if using, and scrape up any onions stuck to pan. Cook until it disappears.
Add stock, herbs (if using), and a lot of freshly ground black pepper and bring soup to a simmer.
Partially cover pot and simmer for 15 to 20 minutes. Taste and adjust seasoning as needed.
While soup is finishing, heat your broiler, and if you don’t have a broiler, heat your oven as hot as it goes.
Toast the bread lightly, rub lightly with a raw garlic clove.
Ladle soup into bowls. Fit a piece of toast onto each. Sprinkle with cheese.
Run under broiler until cheese is melted and brown at edges. Garnish with herbs.
