What do you need for a barrel to be effective for gas projectiles? You need precise sizing and rifling.
Putting aside the issue of materials, the problem I see is automating the process. It seems like you want the barrel to automatically slide out. If your character carried multiple segments of barrels and clipped/screwed them together to suit the particular situation, you'd be fine. You could more or less do the same thing now. There are a number of firearms that can accept different barrels and bolts easily and quick-release barrel systems are not uncommon.
If your barrel was a long, coiled sheet that could stiffen so that it could extend out (like the paper yo-yo above), I do not see how a rifling groove would work. You could extend the barrel, but the rate of coiling would change along the whole barrel, altering the rifling twist rate. Rifling changes a musket in a rifle and is hard to get around.
If your barrel was stored in segments or segmented sleeves that rolled out and clacked together, I don't know what mechanical force would be strong enough to hold them together when the projectile and the gasses pass through, even if you don't worry about the barrel itself withstanding the forces.
I think the best way to go is to change the game. Gyroscopic stabilization is not going to work for you. You likely want a magnetic impeller or a railgun.
If you go with a linear accelerator you want to have projectiles that are thin and light so that you can accelerate them to high speed quickly. You don't spin them because they aren't stabilized. They move so fast and their mass is so low their trajectory is basically laser-flat. They're essentially hypersonic needles. In that case, each barrel segment could be an acceleration stage of impeller coil and a gating electromagnet. Adding more length to the coil would always give you more distance to accelerate. While you could just dump more power in to a shorter segment to accelerate to the same speed in a shorter distance, the electronics may be unable to handle switching that much power at once and accelerating that fast might warp the projectile, causing it to impact the barrel going extremely fast (which would be 'bad'). You are relying on linear acceleration and not gas pressure, so you don't need to hold the barrel together all that tightly. There will be resistance, but given you already have a wire coil, you more or less just need a sleeve to hold it.
As for the actual movement of the barrel, I could see largely two solutions. One is the paper yo-yo layout above. If a material sheet had impeller lines built in, then it could slide out and in. The only issue is that the coils at the back of barrel would be tighter than the front, and you want it to be the opposite way around. The other solution is a bullpup design.
Bullpup rifles have their magazine and receiver behind the handgrip, so by the time the barrel runs from your shoulder, along your arm and to your hand, you've already gone through over a foot of barrel before you hit the grip, so the overall length of the firearm is rather short. If your impeller gun had a barrel along the whole length, but only fired through the segment past the handgrip and used the rest of the stock to essentially store the rest of the barrel, it could then be ratcheted out as needed. The barrel couldn't be one solid piece since you'd need a way to get the projectile in, so it could be constructed in segments. It wouldn't be hard to have an internal mechanism hold the front in place, screw in the next segment and roll the front forward.
It would not be quiet, though. Motors generally only get louder over time. It could be manual, like a bolt-action rifle.
While the same setup could in principle work for a gas projectile, the fact that the barrel could unscrew in multiple places would present problems. The stress of the gases and the projectile's rotary motion as it traveled through the barrel would cause all the joints to loosen. It would essentially disassemble itself. Parts can be reverse threaded, tightening themselves each time you fire, but then you need to overcome how tightly they need to be (and then became..) screwed together in order to extend or retract.
I think a bullpup extensible linear impeller is your best bet.
You would need very good power storage and delivery, however you mentioned advanced science and materials are available.