Melt butter in a large pot over medium heat. Add onions and cook slowly, stirring often. This should take around 20 minutes. The onions should be nice and soft and starting to caramelize.
Stir in garlic (if using), salt, pepper, and onion powder.
Add flour, stir to coat onions, and cook for 2 minutes.
Slowly pour in water or stock, stirring constantly. Add stock powder (if using water). Add thyme.
Simmer uncovered for a further 10 minutes. Remove thyme sprigs.
To make the crispy cheese topping: Line the tray with baking paper. Put ¼ cup mounds of grated cheese on the baking tray. Cook the cheese until it is melted. The cheese will crisp up on cooling.
Ladle soup into bowls, top with a cheese crisp and a little fresh thyme.