Types of materials
Importantly, there's not only one type of asteroid. The size that we're talking about is certainly big enough to be held together by gravity - that's the entire point. But this gravity isn't like moon gravity, it is very very weak. For the most part, gravity isn't giving much resistance to picking up rocks on the surface and throwing them. The back-pressure from the asteroid material, however, is still a concern when one gets sufficiently far down. But the pressure in the center of an asteroid 40 km in diameters isn't any moer than just 10 meters under the ground on Earth. Given that, it's certainly believable that a hole can be self-supporting, after all, we see that in holes on Earth 10 meters deep. But there's more to it, particularly when one wants to create a large pressurized volume in the center, and this is where the asteroid material comes into play. I will vagely categorize the types of structure we could be dealing with from nothing other than my own thinking:
- Hard material, with some strength to it
- Soft material, sand-like or liquid-like
- Porous rock - hard material that's been fractured into many macroscopic pieces
- Fully soft material has some risk of tunnel collapse
- Fully porous to vacuum material can't be relied on as a pressure barrier itself
- Hard material has to be broken in order to be removed
The next logical question would probably be how things can move into the pressurized volume and back out into space through an access tunnel. First, however, the pressure boundary needs to be defined well. Will the pressure of the tunnel be the pressure on the inside, or will it be a vacuum, contiguous with space? For at least initial steps, keeping a full atmosphere of pressure in the tunnel would be easier because you could use flexible materials to line the tunnel.
However, even simple calculations, using a diameter of 4.5 meters leads to a unfavorable material demands when assuming that the pressure boundary is made of simple polymer material.
An alternative is sought. Firstly, it's important to realize that the rock surrounding the tunnel has its own pressure. If the pressure of the tunnel is the same as the surrounding rock, then there's really no need to worry about either cave-in like events or losing the atmosphere through the rock material if it's rigid.
You could try to count on the structural material to hold the tunnel open. Even so, at minimum there would have to be at least one airlock. If you're not going to count on the integrity of the asteroid rock, however, it probably makes sense to stagger the pressure boundaries for a different kind of outcome.
ship locks, with air pressure being the analog to water pressure. There is one important qualifier on that statement, however, which is that the locks would be spaced out almost evenly. Most ship locks have several locks in one big latter, and that would defeat the purpose here. Here, the idea is to equalize the pressure of the tunnel with the rock. It's important to consider the energy that would be required to move something through (into or out of) this tunnel. I figure it would be:
Returning to the previous illustrations including the wide flow buffer, if the material is favorable, you may be able to spare the effort of providing a pressure boundary around the side of the tunnel. That's the idea behind the wide flow barrier. Instead of sealing the entire length of a section (and these are long sections), it's possible that we could use the asteroid for that purpose, but it would depend on the type of material, as I want to illustrate here with porous rock:
Digging the tunnel is still generally an unaddressed challenge. Perhaps you would build these pressure boundaries as you got deep into the dig? That would create extra complications of removing rock material through the airlock.
No matter how you slice it, no consideration for creating the tunnel brings us to highly futuristic or exotic technology. Next, I would like to talk about some complications that can come with the pressure distribution in a rigid material.