import timeit
timeit.timeit('str(s)', 's = None')
timeit.timeit('s if type(s) is str else str(s)', 's = None')
timeit.timeit('str(s)', "s = ''")
Should I avoid converting to a string if a value is already a string?