Melt butter in a large pot or Dutch oven over medium; cook onion 3-4 minutes until softened, then garlic another minute.
Add ham; cook 2 minutes, stirring occasionally.
Add broth, milk, Dijon, salt, and pepper; stir and bring to a boil.
Stir pasta into boiling liquid; reduce heat to medium and cook 10-12 minutes, stirring frequently, until tender and most liquid absorbed.
Add optional peas during last 2 minutes.
Off heat, immediately stir in cheddar and mozzarella until completely melted and creamy.
Stand 2-3 minutes to thicken slightly; serve hot as sauce continues thickening while cooling.