If you are not opposed to using the TOTALLY UNDOCUMENTED API, which is subject to change at any time without notice:
void CoreDockSendNotification(CFStringRef, void *); (...) CoreDockSendNotification(@"com.apple.expose.front.awake", NULL);
Other well-known arguments are @"com.apple.expose.awake" and @"com.apple.dashboard.awake" , which activate Mission Control and Dashboard respectively. @"com.apple.showdesktop.awake" used to activate Show Desktop, but it no longer works with current versions of macOS.
Please note that most applications should not use these calls - these actions are intended to be directly called by the user.
source share