Why not use conditional logic?
def pad_or_slice(L, n):
if len(L) < n:
return L + ([0] * (n - len(L)))
else:
return L[:n]
This way you're only doing one of the two, not both, at the cost of checking the length of the list, which shouldn't be too costly.