In a large stainless steel saucepan or two large cast iron skillets, melt butter over medium-high heat until foaming. Add onions and cook, stirring occasionally, until softened, about 8 minutes. Lower heat to medium-low and cook, stirring frequently, until onions are very sweet and a rich golden-brown color, 1 to 2 hours. If browned bits on the bottom threaten to burn, add 1 tablespoon water, scrape up, and continue cooking. Season with salt and pepper.
Add sherry and bring to a simmer, scraping up any browned bits. Cook until alcohol smell is mostly gone, about 3 minutes. Add stock, thyme, and bay leaf. Raise heat to medium-high and bring to a simmer. Lower heat and simmer for 20 minutes.
Add fish sauce, if using, and cider vinegar. Season with salt and pepper. Discard thyme sprigs and bay leaf.
Preheat broiler and adjust oven rack to top position. Butter toasts and rub with garlic clove until fragrant. Spoon a small amount of broth into the bottoms of 4 ovenproof serving bowls, then top with half the toasts. Sprinkle some grated cheese on top of toasts, then spoon more soup and onions on top, nearly filling bowls. Set remaining 4 toasts in bowls, pushing to nearly submerge them. Top with remaining grated cheese.
Set bowls on a rimmed baking sheet. Broil until cheese is melted and browned in spots. Garnish with chives and serve.