Smash garlic clove with flat side of knife and remove papery skin. Add garlic and half and half to large skillet. Heat over medium heat until hot, but not simmering. Remove garlic cloves. Slowly add Swiss cheese, whisking constantly until cheese is fully incorporated. Add parmesan cheese in the same manner, whisking slowly and constantly until cheese is incorporated. Remove from heat.
Cook pasta according to package directions. While pasta boils, sauté onion in olive oil until translucent. Add ham and tomatoes, cook until heated. Drain pasta. In a large bowl, add pasta, sauce, ham, onions, and tomatoes. Stir in basil. Serve immediately with grated pecorino.