Correcto, aparentemente lo que necesitaba era el uso de un llamado scalar seleccionar . Con el uso de esos, obtengo este código de Python, que en realidad funciona como quiero (genera el SQL equivalente al primero en mi pregunta, que era mi objetivo):
moving_average_days = # configurable value, defaulting to 5
ndays = # configurable value, defaulting to 90
t1 = Measurements.alias('t1') ######
t2 = Measurements.alias('t2')
query = select([t1.c.time, t1.c.value,
select([func.avg(t2.c.value)],
t2.c.time.between(t1.c.time - datetime.timedelta(moving_average_days), t1.c.time)).label('moving_average')],
t1.c.time > (datetime.datetime.utcnow() - datetime.timedelta(ndays))). \
order_by(t1.c.time)
Esto da este SQL:
SELECT t1.time, t1.value,
(
SELECT avg(t2.value) AS avg_1
FROM measurements AS t2
WHERE t2.time BETWEEN t1.time - :time_1 AND t1.time
) AS moving_average
FROM measurements AS t1
WHERE t1.time > :time_2 ORDER BY t1.time;