Python BGL: X-Ray mode
as @CoDEmanX noted you can disable the depth test with bgl.glDisable(bgl.GL_DEPTH_TEST) while drawing and use the POST_VIEW.

here is an example code of a modified draw modal operator :



import bpy
import bgl
import blf
from mathutils import Vector
from bpy_extras import view3d_utils

def draw_callback_px(self, context, points):

    bgl.glEnable(bgl.GL_BLEND)
    bgl.glColor4f(1.0, 1.0, 1.0, 1.0)
    bgl.glLineWidth(2)
    bgl.glDisable(bgl.GL_DEPTH_TEST)

    bgl.glBegin(bgl.GL_LINE_STRIP)
    for x, y, z in self.points:
        bgl.glVertex3f(x, y, z)
    bgl.glEnd()

    # restore opengl defaults
    bgl.glLineWidth(1)
    bgl.glDisable(bgl.GL_BLEND)
    bgl.glEnable(bgl.GL_DEPTH_TEST)
    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)

class ModalDrawOperator(bpy.types.Operator):
    """Draw a line with the mouse"""
    bl_idname = "view3d.modal_operator"
    bl_label = "Simple Modal View3D Operator"

    def modal(self, context, event):
        context.area.tag_redraw()

        if event.type == 'LEFTMOUSE':
            if event.value == 'RELEASE':
                co_2d = Vector((event.mouse_region_x, event.mouse_region_y))
                viewport = context.area.regions[4]
                r3d = context.area.spaces[0].region_3d
                nor =  view3d_utils.region_2d_to_vector_3d(viewport, r3d, co_2d)
                v3 =  view3d_utils.region_2d_to_location_3d(viewport, r3d, co_2d, nor)

                self.points.append(v3) 

        elif event.type in {'RIGHTMOUSE', 'ESC'}:
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        if context.area.type == 'VIEW_3D':
            self.points = []
            args = (self, context, self.points)
            self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_VIEW')
            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}
        else:
            self.report({'WARNING'}, "View3D not found, cannot run operator")
            return {'CANCELLED'}

def register():
    bpy.utils.register_class(ModalDrawOperator)

def unregister():
    bpy.utils.unregister_class(ModalDrawOperator)

if __name__ == "__main__":
    register()