diff --git a/numba/typing/templates.py b/numba/typing/templates.py
index f09dba502..03893ded1 100644
--- a/numba/typing/templates.py
+++ b/numba/typing/templates.py
@@ -7,6 +7,7 @@ import sys
 import inspect
 import os.path
 from collections import namedtuple
+from collections.abc import Sequence
 from types import MethodType, FunctionType
 
 import numba
@@ -147,6 +148,9 @@ def fold_arguments(pysig, args, kws, normal_handler, default_handler,
     - default_handler(index, param, default) is called for omitted arguments
     - stararg_handler(index, param, values) is called for a "*args" argument
     """
+    if isinstance(kws, Sequence):
+        # Normalize dict kws
+        kws = dict(kws)
 
     # deal with kwonly args
     params = pysig.parameters

Further problems with literally in overload
I saw that @sklam fixed #5011 with #5018. I believe I have stumbled across another problem with `literally` in `@overload` present in 0.47 and 0.48dev0.

The implementations of numpy functions with `axis` parameters use an idom like the following:
```python
if axis == 0:
    index_tuple0 = _gen_index_tuple(arr.shape, axis_index, 0)
    # snip
elif axis == 1:
    index_tuple0 = _gen_index_tuple(arr.shape, axis_index, 1)
    # snip
```

I thought this would now no longer be necessary but could be replaced by a common implementation for all axis values like so:
```python
axis_val = literally(axis)
index_tuple = _gen_index_tuple(arr.shape, axis_index, axis_val)
```

Unfortunately that fails to compile with the message:
```
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Internal error at .
bind() argument after ** must be a mapping, not list
[1] During: resolving callee type: Function()
[2] During: typing of call at  (121)

Enable logging at debug level for details.

File "", line 121:
    def test_numba_axis_max(arr, axis):
        return np.max(arr, axis=axis)
        ^
```

Should this work or am I misusing `literally`?

Reproducer in the details below:

<details>

```python
import numba.types as types
import numpy as np
from numba import literally, njit
from numba.extending import overload, overload_method, register_jitable
from numba.targets.arraymath import _gen_index_tuple, zero_dim_msg


@register_jitable
def _array_max_binary_op(operand1_in_out, operand2_in, inplace=False):
    assert operand1_in_out.shape == operand2_in.shape
    if inplace:
        result = operand1_in_out
    else:
        result = np.copy(operand1_in_out)

    out = result.flat
    in2 = operand2_in.flat
    for i in range(operand1_in_out.size):
        if in2[i] > out[i]:
            out[i] = in2[i]
    return result


def gen_max_axis_impl(is_axis_const, const_axis_val):
    def array_max_axis_impl(arr, axis=None):
        """
        function that finds the maximum over one specific axis

        The third parameter to gen_index_tuple that generates the indexing
        tuples has to be a const so we can't just pass "axis" through since
        that isn't const.  We can check for specific values and have
        different instances that do take consts.  Supporting axis summation
        only up to the fourth dimension for now.

        typing/arraydecl.py:sum_expand defines the return type for sum with
        axis. It is one dimension less than the input array.
        """
        ndim = arr.ndim

        if not is_axis_const:
            # Catch where axis is negative or greater than 3.
            if axis < 0 or axis > 3:
                raise ValueError(
                    "Numba does not support sum with axis "
                    "parameter outside the range 0 to 3."
                )

        # Catch the case where the user misspecifies the axis to be
        # more than the number of the array's dimensions.
        if axis >= ndim:
            raise ValueError("axis is out of bounds for array")

        # Convert the shape of the input array to a list.
        ashape = list(arr.shape)
        # Get the length of the axis dimension.
        axis_len = ashape[axis]
        # # Remove the axis dimension from the list of dimensional lengths.
        # ashape.pop(axis)
        # # Convert this shape list back to a tuple using above intrinsic.
        # ashape_without_axis = _create_tuple_result_shape(ashape, arr.shape)
        # # Tuple needed here to create output array with correct size.
        # result = np.full(ashape_without_axis, zero, type(zero))

        if is_axis_const:
            # constant specialized version works for any valid axis value
            index_tuple_generic = _gen_index_tuple(arr.shape, 0, 0)
            result = np.copy(arr[index_tuple_generic])
            for axis_index in range(1, axis_len):
                index_tuple_generic = _gen_index_tuple(
                    arr.shape, axis_index, const_axis_val
                )
                result = _array_max_binary_op(result, arr[index_tuple_generic])
        else:
            axis_val = literally(axis)
            index_tuple0 = _gen_index_tuple(arr.shape, 0, axis_val)
            result = np.copy(arr[index_tuple0])
            for axis_index in range(1, axis_len):
                # Generate a tuple used to index the input array.
                # The tuple is ":" in all dimensions except the axis
                # dimension where it is "axis_index".
                index_tuple0 = _gen_index_tuple(arr.shape, axis_index, axis_val)
                result = _array_max_binary_op(result, arr[index_tuple0])
        return result

    return array_max_axis_impl


@overload(np.max)
@overload_method(types.Array, "max")
def array_max(arr, axis=None):
    if not isinstance(arr, types.Array):
        return

    if axis is None or isinstance(axis, types.Omitted):
        return
    elif isinstance(axis, types.IntegerLiteral):
        # this special-cases for constant axis
        const_axis_val = axis.literal_value
        # fix negative axis
        if const_axis_val < 0:
            const_axis_val = arr.ndim + const_axis_val
        if const_axis_val < 0 or const_axis_val > arr.ndim:
            raise ValueError("'axis' entry is out of bounds")
        is_axis_const = True
    elif isinstance(axis, types.Integer):
        is_axis_const = False
        const_axis_val = 0
    else:
        return
    return gen_max_axis_impl(is_axis_const, const_axis_val)


if __name__ == "__main__":
    ### test max(arr, axis) implementation
    test_dims = [3, 3, 3]
    a = np.random.rand(np.prod(test_dims)).reshape(test_dims)


    @njit(cache=True)
    def test_numba_axis_max(arr, axis):
        return np.max(arr, axis=axis)


    assert np.all(np.max(a, axis=0) == test_numba_axis_max(a, 0))

```

</details>
diff --git a/numba/tests/test_typeinfer.py b/numba/tests/test_typeinfer.py
index 3b6ae2f0c..38e20e871 100644
--- a/numba/tests/test_typeinfer.py
+++ b/numba/tests/test_typeinfer.py
@@ -6,6 +6,7 @@ import numpy as np
 from numba import unittest_support as unittest
 from numba.compiler import compile_isolated
 from numba import types, typeinfer, typing, jit, errors
+from numba import utils
 from numba.typeconv import Conversion
 
 from .support import TestCase, tag
@@ -678,5 +679,60 @@ class TestMiscIssues(TestCase):
             self.assertEqual(res, pyfunc(v))
 
 
+class TestFoldArguments(unittest.TestCase):
+    def check_fold_arguments_list_inputs(self, func, args, kws):
+        def make_tuple(*args):
+            return args
+
+        unused_handler = None
+
+        pysig = utils.pysignature(func)
+        names = list(pysig.parameters)
+
+        with self.subTest(kind='dict'):
+            folded_dict = typing.fold_arguments(
+                pysig, args, kws, make_tuple, unused_handler, unused_handler,
+            )
+            # correct ordering
+            for i, (j, k) in enumerate(zip(folded_dict, names)):
+                (got_index, got_param, got_name) = j
+                self.assertEqual(got_index, i)
+                self.assertEqual(got_name, f'arg.{k}')
+
+        kws = list(kws.items())
+        with self.subTest(kind='list'):
+            folded_list = typing.fold_arguments(
+                pysig, args, kws, make_tuple, unused_handler, unused_handler,
+            )
+            self.assertEqual(folded_list, folded_dict)
+
+    def test_fold_arguments_list_inputs(self):
+        cases = [
+            dict(
+                func=lambda a, b, c, d: None,
+                args=['arg.a', 'arg.b'],
+                kws=dict(c='arg.c', d='arg.d')
+            ),
+            dict(
+                func=lambda: None,
+                args=[],
+                kws=dict(),
+            ),
+            dict(
+                func=lambda a: None,
+                args=['arg.a'],
+                kws={},
+            ),
+            dict(
+                func=lambda a: None,
+                args=[],
+                kws=dict(a='arg.a'),
+            ),
+        ]
+        for case in cases:
+            with self.subTest(**case):
+                self.check_fold_arguments_list_inputs(**case)
+
+
 if __name__ == '__main__':
     unittest.main()

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc g++
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi @ file:///croot/certifi_1671487769961/work/certifi
exceptiongroup==1.2.2
importlib-metadata==6.7.0
iniconfig==2.0.0
llvmlite==0.31.0
-e git+https://github.com/numba/numba.git@d7953a18dbf5ea231dc16e967ce8e9b754578ea6#egg=numba
numpy==1.21.6
packaging==24.0
pluggy==1.2.0
pytest==7.4.4
tomli==2.0.1
typing_extensions==4.7.1
zipp==3.15.0

name: numba
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - argparse==1.4.0
      - exceptiongroup==1.2.2
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - llvmlite==0.31.0
      - numpy==1.21.6
      - packaging==24.0
      - pluggy==1.2.0
      - pytest==7.4.4
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - zipp==3.15.0
prefix: /opt/conda/envs/numba

numba/tests/test_typeinfer.py::TestFoldArguments::test_fold_arguments_list_inputs
numba/tests/test_typeinfer.py::TestArgRetCasting::test_arg_ret_casting numba/tests/test_typeinfer.py::TestArgRetCasting::test_arg_ret_mismatch numba/tests/test_typeinfer.py::TestArgRetCasting::test_invalid_arg_type_forcing numba/tests/test_typeinfer.py::TestUnify::test_arrays numba/tests/test_typeinfer.py::TestUnify::test_bool numba/tests/test_typeinfer.py::TestUnify::test_integer numba/tests/test_typeinfer.py::TestUnify::test_list numba/tests/test_typeinfer.py::TestUnify::test_none numba/tests/test_typeinfer.py::TestUnify::test_none_to_optional numba/tests/test_typeinfer.py::TestUnify::test_optional numba/tests/test_typeinfer.py::TestUnify::test_optional_tuple numba/tests/test_typeinfer.py::TestUnify::test_range numba/tests/test_typeinfer.py::TestUnify::test_set numba/tests/test_typeinfer.py::TestUnify::test_tuple numba/tests/test_typeinfer.py::TestUnify::test_unify_number_pair numba/tests/test_typeinfer.py::TestTypeConversion::test_arrays numba/tests/test_typeinfer.py::TestTypeConversion::test_convert_number_types numba/tests/test_typeinfer.py::TestTypeConversion::test_optional numba/tests/test_typeinfer.py::TestTypeConversion::test_tuple numba/tests/test_typeinfer.py::TestResolveOverload::test_ambiguous_error numba/tests/test_typeinfer.py::TestResolveOverload::test_ambiguous_match numba/tests/test_typeinfer.py::TestResolveOverload::test_non_ambiguous_match numba/tests/test_typeinfer.py::TestUnifyUseCases::test_complex_unify_issue599 numba/tests/test_typeinfer.py::TestUnifyUseCases::test_complex_unify_issue599_multihash numba/tests/test_typeinfer.py::TestUnifyUseCases::test_int_tuple_unify numba/tests/test_typeinfer.py::TestMiscIssues::test_issue_1080 numba/tests/test_typeinfer.py::TestMiscIssues::test_issue_1394 numba/tests/test_typeinfer.py::TestMiscIssues::test_issue_797 numba/tests/test_typeinfer.py::TestMiscIssues::test_list_unify1 numba/tests/test_typeinfer.py::TestMiscIssues::test_list_unify2 numba/tests/test_typeinfer.py::TestMiscIssues::test_range_unify
numba/typing/templates.py
numba/typing/templates.py