Having a documented API and the game actually abiding by it would probably be way more expensive than ensuring you can dump the source code on the community on end of life. The latter is only (sometimes) costly now because the industry is not built around it.