I’m told the “remodel” application is meant to do this very efficiently, but I’ve never used it.
The simplest way is to use a text editor to add/delete residues manually (using a text editor; garbage coordinates are ok, just make sure all the backbone heavyatoms (C, CA, N, O) are present) and then use the -build_initial option in loop modeling.
There is also a demo in AnchoredDesign/loop_length_changing.