If it's a quill stem, then the stem comes off without any impact on the adjustment of the headset. If it's a threadless headset, you should be able to remove the handlebars and leave the stem in place, again without touching the headset adjustment. Are there 4 bolts and a removable section that attach the handlebars to the stem? If so, just undo those 4 bolts. Then you find a way to pack the handlebars close to the top of the fork where all the cables can reach. Sometimes you can loop the bars over the top tube or around one of the wheels.