In the Luger's case, as well as the C96 Mauser, which also had an exposed barrel, form follows function.
There's no traditional slide on the Luger or Mauser, so why does the barrel need to be enclosed? Simple answer is, it doesn't, because the action type doesn't call for it.
As others have noted, open-top slides aren't rare on new designs, either.
------------------
Beware the man with the S&W .357 Mag.
Chances are he knows how to use it.