The Java SDK has a nice Reify PTransform that can be used to add timestamp, window info to elements of a PCollection. This makes adding timestamp, window info reusable and easy instead of defining DoFns every time.
Also, this can make a pipeline look really neat. Eg: This PR.
This can be added to the util module of the Python SDK.