Melt 1 tablespoon butter in a wide skillet over medium-low heat. Add onion and cook for 20 to 25 minutes, stirring often, until soft and golden.
Meanwhile, cook cavatappi in a large pot of water with the tablespoon salt until just tender. Reserve 1/2 cup pasta water and drain.
Add the remaining butter to the onion skillet, whisk in flour for 1 minute, then gradually stir in beer and milk. Add sauce salt and pepper and simmer for 4 minutes.
Remove from the heat and stir in Gouda by handfuls until smooth. Fold in the pasta.
Loosen with reserved pasta water a tablespoon at a time if needed and serve while the cheese sauce is creamy.