Scripts/Misc: Small code optimizations
Core/Commands: Handle "" as empty string argument

Fixes #11548