SpaceX is already contracted by NASA to develop a lander to take the Artemis astronauts from lunar orbit down to the lunar surface and back to the "gateway" lunar orbiter.
So, SpaceX needs to develop Starship versions that will provide refueling in Earth orbit and probably also in lunar orbit. And SpaceX will need to develop the capability to get the lander(s?) and fuel to lunar orbit, because NASA is not working on that part, either.
So, it should not be a problem for SpaceX to put humans on the Moon, even without NASA being involved. The main component from NASA is the Orion capsule that can return from the Moon with direct reentry through the atmosphere, which creates a lot more heat to deal with than just reentering from low Earth orbit. But, it has already been done by the Apollo missions.
However, another approach would be to have the returning craft use rocket fuel for braking into low Earth orbit, and then take another vehicle down to the surface. That would make sense for a sustained lunar base scenario, where the idea is to make everything reusable to reduce costs. So, specialized craft to go between low Earth Orbit and lunar orbit does cost more fuel than coming in directly to atmospheric reentry, but probably costs less money, when you take into account the reusability and the fuel costs of putting throw-away spacecraft into space from Earth's surface.
As soon as I read that NASA had contracted with SpaceX to get the NASA astronauts onto the lunar surface from lunar orbit (and back again), I started wondering when it was going to become obvious that SLS could be replaced by StarShip + SuperHeavy.