There's a way to access that variable from RF and log to the console (depends on OperatingSystem library). There's no option to log to the console in BuiltIn, but you can do it like this:
Log Build Number
${build number}= OperatingSystem.Get Environment Variable BUILD_VCS_NUMBER NON_TC_BUILD
${logger}= Evaluate robot.api.logger robot
Call Method ${logger} console \nThis is build number: ${build number}
In Python you can do something like this:
import os
from robot.api import logger
...
def output_build_details(self):
build_number = os.environ.get('BUILD_VCS_NUMBER', 'NON_TC_BUILD')
logger.console('\nThis is a build number: ' + build_number)