Assign cycles material to mesh in script
As batFINGER mentioned, you just forgot the return statement.
I tried out your code (and had to modify it a bit, because I got the error that 'scene' was not defined) and it worked fine when I added return mat to the function create_cycles_material.

Here's the ready to use code:

import bpy

def main():
    g_d = bpy.data.meshes.new(name="GroundM")
    g_o = bpy.data.objects.new(name="GroundO", object_data = g_d)
    scene = bpy.data.scenes[0]
    scene.objects.link(g_o)
    g_o.location = (0,0,0)
    g_o.select = True
    scene.objects.active = g_o

    ColoredGround = create_cycles_material('GroundCol')
    setMaterial(g_o, ColoredGround)

def create_cycles_material(name):

    mat = bpy.data.materials.new(name)
    mat.use_nodes = True
    nodes = mat.node_tree.nodes

    node = nodes['Diffuse BSDF']
    node.location = 600, 120
    #pass   # Some more node-engineering here
    return mat

def setMaterial(ob, mat):
    me = ob.data
    me.materials.append(mat)

if __name__ == '__main__':
    main()