Fix build_configuration.py: Use type hinting in docstring instead of function annotation.

We cannot use type annotations in these cases because the names of the
containing class, or later classes in the same file, are not defined
at the point in time when the function annotation is evaluated.
Also use docstring instead of function annotation for "generic" types.

According to https://mail.python.org/pipermail/python-ideas/2014-August/028618.html,
using function annotations for this might become possible in the future, though.
Also use docstring instead of function annotation to remove import clutter.
Replace all hardcoded references to https://github.com/ros-infrastructure/ros_buildfarm.git with the appropriate variables.
Use a workaround for get_repository_url when git is not installed.