In a large pot of boiling, salted water, cook the pasta until al dente, about 8 minutes. Drain, then return to pot.
Meanwhile, in a large, deep skillet, cook the bacon and onion over medium-high heat, stirring occasionally, until the bacon is just crisp and the onion is softened, about 8 minutes. Transfer the mixture to a bowl. Melt the butter in the skillet, whisk in the flour and cook, stirring constantly, for 1 minute. Whisk in the milk and bring just to a boil. Lower the heat to medium-low and simmer, stirring often, until thickened, 1 to 2 minutes. Add the cream cheese and cook, stirring constantly, until just melted. Remove from the heat and stir in the cheddar cheese, a handful at a time, until smooth.
Add the cheese sauce to the pasta and stir until combined; season with salt and pepper. Top with the bacon-onion mixture.