How do I make the mat_name = all the materials on an object?
I think you are getting too focused on the details and need to evaluate the overall goal. Sounds like you want to do:
Premise:
Given an object
if no material assigned create new material
For each material in material_slots
ensure use_nodes = True
Add shader node 'ShaderNodeTexImage'
Set node location (0,0)
import bpy

ob = bpy.context.object

def add_image_node(ob):
    if not ob.material_slots:
        ob.data.materials.append(bpy.data.materials.new(ob.name))
    for mat in ob.data.materials:
        mat.use_nodes = True
        my_node = mat.node_tree.nodes.new('ShaderNodeTexImage')
        my_node.location = (0,0)

add_image_node(ob)

In which case he only name used is when creating a new material.
Edit added alternative code including linking example and some potential issues identified in comments to consider for your specific goals.
import bpy

ob = bpy.context.object

def link_texture(mat, nd_from, nd_to, ip_socket, op_socket):
    mat.node_tree.links.new(nd_to.inputs[ip_socket], nd_from.outputs[op_socket])

def add_texture_node(mat):
    tex_node = mat.node_tree.nodes.new('ShaderNodeTexImage')
    tex_node.location = (0,0)
    return tex_node

def add_mat_by_slot(ob):
    if not ob.material_slots:
        bpy.ops.object.material_slot_add()
    for slot in ob.material_slots:
        if not slot.material:
            new_mat = bpy.data.materials.new(ob.name)
            slot.material = new_mat
        slot.material.use_nodes = True
        # should there be a check before adding to prevent duplicates?
        if 'Image Texture' not in slot.material.node_tree.nodes:
            my_node = add_texture_node(slot.material)
        else:
            # reference existing node
            my_node = slot.material.node_tree.nodes['Image Texture']
        
        # potentially more than one bsdf which to connect to or all
        nds_to = [nd for nd in slot.material.node_tree.nodes if nd.type == 'BSDF_PRINCIPLED']
        
        # convenience variables to choose sockets by name
        ip_sock = &quot;Base Color&quot;
        op_sock = &quot;Color&quot;
        
        for nd in nds_to:
            # do you want to skip if link already exists to avoid over writing?
            if nd.inputs[ip_sock].links:
                continue
            link_texture(slot.material, my_node, nd, ip_sock, op_sock)

add_mat_by_slot(ob)