Given your statement "pending investigation with authorities", you will want to continue to discuss this with your legal counsel, and with a forensics provider if and as that discussion is deemed appropriate.
Apache is capable of and can be configured to run CGI apps, yes.
As for the rest of it, check with school IT, and—for differences from the expected or for install-related concerns—check with a clean install of the same version of macOS, with or without macOS Server installed.
What an organization installs varies, as do macOS installs.
Much (all?) of what you reference is not installed by default, though can be added.
As for the path alluded to, some versions of macOS Server do have /Library/WebServer/CGI-Executables/, but not much is found in that in the default macOS client install. Certainly not macOS client on recent versions. Conversely, macOS Server used /Library/WebServer extensively.
Web browser references to /cgi-bin/ are usually configured to reference the contents of /Library/WebServer/CGI-Executables/, as well.
Check Time Machine backups, if questions arise about when some component was added or changed, too.
macOS Server had a "powered by" shown by Apache in some contexts, as did at least some configurations with macOS client. Here's one older version of that client logo:

macOS Server and OS X Server IIRC included "Server" in their default displays. I don't have one of those OS X Server or macOS Server configuration images immediately handy.
Different versions had different displays, as well.