1. In a large pot, melt the butter over medium heat. Add the diced onion and cook until translucent, about 5 minutes.
2. Add the minced garlic and cook for another minute.
3. Sprinkle the flour over the onions and garlic, stirring constantly for about 2 minutes to form a roux.
4. Slowly whisk in the chicken broth and beer, making sure there are no lumps.
5. Bring the mixture to a simmer and cook for about 10 minutes, allowing it to thicken.
6. Reduce the heat to low and stir in the shredded cheddar cheese until melted and smooth.
7. Stir in the heavy cream, salt, and black pepper. Cook for another 5 minutes, stirring occasionally.
8. Serve hot, garnished with additional shredded cheese or croutons if desired.