Forward Vector in Blender (python)
To express some object's local y axis in world coordinates you just multiply a (0,1,0) vector with the object's world matrix:

import bpy
form mathutils import Vector

ob = bpy.context.scene.objects.get("Object")
forward = ob.matrix_world * Vector((0,1,0))


If the object has scale and you need a vector with unit length, you also need to normalize the result.