Dire, Dire Docks

Dire, Dire Docks is the ninth course in Super Mario 64. It is accessed after the 30-star door and is accessed through a water-like portal. The level is split into two parts that are linked by a long winding tunnel. The first part that Mario spawns into is an enormous alcove filled to the brim with water, with an underwater cyclone at the bottom. The second part is coated in metal walls and if Bowser and the Fire Sea has not been completed, a large submarine with Bowser's face painted on it.

Theorising
Some theorize this is the way that Bowser got into Princess Peach's Castle. There is no damage done to the castle from the exterior, therefore Bowser couldn't have attacked his way into the castle. With the Bowser submarine located in this level, and subsequently disappearing along with the hole leading to the castle grounds opening after beating Bowser and the Fire Sea, it can be presumed that Bowser used this submarine to sneak into Dire, Dire Docks. Next, he used the portal to make his way into the basement of the castle.

It can be presumed the portal isn't like the other paintings in the castle. As it intentionally covers up the entrance into Bowser and the Fire Sea until the first star is collected. It's theorized that Bowser created this portal with black magic.