Various unexpeced errors, if initialized timer is not referenced by pythoncode
When Timer is initialized, but instance is no longer referenced from python code, it's probably subject for GC.
Unfortunatelly after GC there are unexpected errors, when timer should fire.
Most probably underlaying RTOS or c++ code is still trying to reference memory, which was used by python Timer object, which is now gone.
initial topic: https://forum.micropython.org/viewtopic.php?f=2&t=5898&p=33812#p33812
esp32/machine.timer.c: Fix timer.value() of an uninitialized timer.
Summary
Raises a value error in that case, which happens after a timer was created but not initialized or after calling timer.deinit(). Fixes issue #17033 / #17035.
Testing
Tested with a ESP32_GENERIC before and after the change, for both a) the state after creating the timer but not initializing it, and b) after calling timer.deinit() on a previously operating timer. In both states, the change causes the error to be raised.
Testing with a generic ESP32 seems to be sufficient, since the change is not specific for a ESP32 variant.
Trade-offs and Alternatives
Alternatively a neutral value like 0 or -1 could be returned instead of raising an error.