How to set the socket type in python?
You define the type when you create the socket with new() Looking at the list on the bpy.types page there are several starting with NodeSocket that can be used.

The variations of each type alter the visual display - eg. FloatPercent shows % with the value.

NodeSocketBool
NodeSocketColor
NodeSocketFloat
NodeSocketFloatAngle
NodeSocketFloatFactor
NodeSocketFloatPercentage
NodeSocketFloatTime
NodeSocketFloatUnsigned
NodeSocketInt
NodeSocketIntFactor
NodeSocketIntPercentage
NodeSocketIntUnsigned
NodeSocketShader
NodeSocketString
NodeSocketVector
NodeSocketVectorAcceleration
NodeSocketVectorDirection
NodeSocketVectorEuler
NodeSocketVectorTranslation
NodeSocketVectorVelocity
NodeSocketVectorXYZ