Can I colour the same text in two different colours?
Create two materials, set their colors.
Then enter edit mode in your text.
Select the wanted letters Shiftkeyboard arrows, and assign them to the wanted material.

General indications to do that using Python:
import bpy

# Get the text
o = bpy.data.objects['Text']

# Get all the characters descriptions
characters = [c for c in o.data.body_format.items()]

# Look at it:
for character in characters: 
    # The index of the char
    print(character[0])
    # The format to the char
    print(character[1])

# Get the third char (for instance)
my_char = characters[2]

# Get its format
my_char_format = my_char[1]

# Assign it a (existing) material index
my_char_format.material_index = 1