Yes it works as you said. Hence this cannot be the reason for my problem.
I don't understand. As far as I understood, you previously said that if you hold down the power button, the lens does not extract and script get_mode falsely reports the camera is in record mode. I can't see how both this and your most recent post can be true at the same time...
And script performance slows down by factor of 2.
How are you measuring this? In general unless you mess with set_yield, script execution time will be dominated by the automatic yields to make sure kbd_task doesn't hog the CPU, and unless your script is extremely complicated or using loops with lots of iterations, actual code execution time is negligible.
Is it normal that CCD temperature correlates to camera performance?
This isn't something I've heard of or observed before, but I haven't looked for it. Thermal throttling is not unexpected in this kind of device. The camera may also change noise reduction strategies based on temperature, which could affect shooting time. 71 C seems quite high, I don't recall ever seeing much over 50 on my cams.
What would be critical temperature values that should be avoided?
Assuming your observation is correct, that's something you'll need to determine by experiment.