A path is always a Unicode string, while a DB name can be an arbitrary binary blob.
On many POSIX platforms, a path is a blob which does not contain '\000'. These systems do not enforce Unicode encoding at all.
My mistake. I was unaware. On those platforms, how do you type a path name into a terminal?
There are some files which are not directly nameable. Many programs support special sequences such as “Ctrl+V 3 7 7” to enter arbitrary bytes, but that's not universal. Depending on the actual implementation of the terminal, cut-and-paste of funny file names can work, too.
Older programs have trouble accessing such files even if the user chooses them in a file selection dialog, but current version are supposed to have been fixed (including OpenJDK, which took a ridiculously long time). Beyond that, it's not much different from dealing with file names in an unfamiliar script.
Interesting. So ultimately, there are always going to be things that you cannot type into your terminal directly.