def gen_all_strings(word):
    """
    Generate all strings that can be composed from the letters in word
    in any order.

    Returns a list of all strings that can be formed from the letters
    in word.
    """
    # Establish base case
    if len(word) == 0:
        return [""]
    else:
        # Split word into first letter and remaining
        first = word[0]
        remaining = word[1:]
        # Recursively generate all strings out of remaining
        remaining_strings = gen_all_strings(remaining)
        # Find all strings that include first letter at any position in string
        missing_strings = []
        for index_word in range(len(remaining_strings)):
            # "+1" ensures the first character is added at the word's end too
            for index_char in range(len(remaining_strings[index_word]) + 1):
                current_word = remaining_strings[index_word]
                # Add slice of word + missing character + end slice of word
                new_word = current_word[0:index_char] + first + current_word[index_char:]
                missing_strings.append(new_word)
                # Add back these missing strings
    all_strings = remaining_strings + missing_strings
    return all_strings