This is almost entirely made possible thanks to the work of the UnrealEngine PythonSDK team. See the video below for a brief demonstration.
An UnrealEngine PythonSDK mod for Borderlands 2 and Borderlands: The Pre-Sequel! that provides a number of useful functions while in game: