This is simply not true, if you know that all the geometry in your scene is going to cover the whole back buffer than not clearing the back buffer saves quite a bit of time, and this is general practice in games. In debug builds its often a good idea to actually use alternating colors, and clearing in generally, this will catch not covering the whole buffer fast.
What I am asking is don't these non changing definitions inside a running loop consume extra cpu time? Or does the computer somehow know it only needs to deal with them once even though they are declared in this constantly running body of code?
Actually you should clear the render target everytime before you draw something on its buffer, but that doesn't mean that's the only way do that it is to create a bgColor variable inside the function.
Generally the compiler will optimise this stuff away anyway in a release build, it will most likely see that it can directly pass the arguments to the Clear call. These things are micro optimisations to start writing this different. Its a lot clearer if the code is written like you have presented it and letting the compiler figure out how it can do those 3-4 lines faster.
You're correct NightCreature. My intention was saying to clear before rendering the entire scene in the most simpler case. If he draws everytime he would be seeing only the last object being rendered. Thanks for correcting.
That is also not what I am saying, I am actually saying that you dont need the clear at all, if you know that what you are about to render will cover the entire back buffer then not doing the clear will be faster. And this can be done in multiple calls.