What is the effect of operating systems on execution speed?
This question doesn't have a straight forward answer, or rather the answer is very case dependent.  (And as some of the comments pointed out, attempting to qualify this as MHz is meaningless, your CPU will run at the same speed regardless {not counting power optimizations}, it's just a case of who's code it's running, yours or the OS's). 

An operating system does many things for you so your simple code that does a couple of I/O operations wouldn't be as simple without calls to the operating system.  To take the OS out of the equation, you'd have to write more code to replace device driver functionality.  Your OS is doing a LOT of work just to accept that letter "A" you typed and display it on a screen.

If your I/O is to a file system, you'd have to write code to replace the file system code provided for you by the OS.  

If you expect multiple tasks to run simultaneously or do multithreading, you'll also have to write code to replace the scheduling functionality. 

If you allocate and deallocate memory, you'd have to write code to perform those functions. 

If you want your program to be notified when an event occurs or keep time or any of a number of other functions, you'll have to supply all that code as well.  And that's just PART of what an Operating System is doing.

You also have to consider that all that OS code that you're taking advantage of has been optimized and debugged for you.  You're likely to write replacement code that is buggier and slower than the OS code you're replacing.  

Then once you've got all that written, you'll have to figure out how to load the program into memory and start execution...

That said, there definitely IS overhead involved in using an operating system.  Most OS's are built for a general use case and will have many features and functions that you don't need for your specific program.  But most of us are willing to give up a few % of CPU and memory in order to get the convenience that an OS will bring.  

As for which OS will make it go faster... again it depends on your application and needs.  Some OS's will definitely run some applications faster than others, but which OS runs faster depends on the features being used.  

And there are reasons other than speed to choose one over another.  Application availability, security, interoperability, device compatibility, availability of programming tools, etc. are all factors to consider.