Might have the same issues as the barn door, but something like a pocket door might help maximize the width (assuming you don't need access to that door under the other stairs). It would at least be a little better for noise.
For a more "standard" door, you could basically just install the door jamb right up to the existing wall. It would be tricky to trim it nicely, but you'd only need about an inch of space on each side that way. And if you're careful, you can make it so the door can open almost a full 180 degrees into the basement to make it easier to move furniture.
Your other option for gaining space is removing the drywall/plaster from the wall of the stairs and replace it with paneling or something else thinner. Could get an extra half or three-quarter inch maybe?

I'll probably take out the red part and expand the door jamb to fill the green section