Chop bacon and cook bacon in instant pot on sauté until crisp. Remove bacon with a slotted spoon and place on paper towels. Reserve grease.
Still on sauté, cook beef and onion, if using, in bacon grease, stirring frequently until beef is no longer pink. Drain in a colander.
In a clean insert, add pasta and 4 cups water. Close lid, turn to seal, and cook on manual-high for 4 minutes. Use quick pressure release.
Remove lid. Turn to sauté. Add milk and butter, and stir until butter melts. Add cheese and stir until cheese melts. Stir in bacon, beef mixture, pickles, and salt and pepper.