It's illegal or it's legal. Yes flying out over a cliff allowing the aircraft to be anything over 400' above the ground directly under the aircraft is ILLEGAL.
That's not legal in the US unless you are Part 107. There's no exception for recreational pilots for being above 400 AGL even if you are next to a structure.
As was already stated, that is NOT A loophole. A mountain/hill/cliff whatever is not a STRUCTURE and as such does not give the Part 107 operator the ability to use it as such. Recreational Operators don't have the "Structure" allowance either way.
For those who want to argue a mountain/hill could be a structure, you're wrong and the FAA clearly defines structures etc. In simple terms, it is something manmade.... built/erected. Dirt piles, rock piles etc also don't count as "structures".
Towers, Cranes, Utility Assemblies, Buildings... those are examples of structures as per the FAA.