I've found this rather useful when repeatedly deploying updated firmware
images to a large number of nodes.
The patch carefully avoids full rebuilds of any "real" source files by
putting the timestamp into a separate .cpp file. It also works around
PlatformIO's build cache that would happily permanently cache the timestamp
file if we were using __DATE__.
The Python script isn't entirely necessary because we could just simply
touch the timestamp file via extra_scripts to force a rebuild. But we'd
need _some_ kind of script anyway and this way we can format the timestamp
more easily than is possible with C++.