# create a line geometry using shapely
line = shapely.geometry.LineString([p1, p2])
# combine shapes into a geometrycollection
gc = shapely.geometry.collection.GeometryCollection([line, p1, p2])
from fastkml import KML
from fastkml import Placemark
pm = Placemark(geometry=gc)
k = KML(features=[pm])
more in the documentation