I have used apps for this, and I used to have these commands installed as system services, but now I think simply having them as shell aliases on macOS is the most useful way to hide/show the flotsam & jetsam that has accrued on my Desktop at any point in time.
alias hidetop='defaults write com.apple.finder CreateDesktop false; killall Finder'
alias showtop='defaults write com.apple.finder CreateDesktop true; killall Finder'