The pkgs: part creates an anonymous function with pkgs as an argument name and the stuff after : as the returned value. It does not really make sense to put one function after another – you should have a single function and then join the arrays with ++ operator inside. In order to do that you will also need to wrap each with ...; ... statement inside parentheses to make them clear.
It is also possible to nest with statements but I would advise against it since it makes it hard to tell where does each thing come from.
Also you should either use python310 with python310.pkgs, or python310Packages.python with python310Packages. Mixing them together can lead to a confusing mismatch if you override a wrong one using overlay.
Right you can omit the parentheses around the first with statement, since even though the expression is interpreted as follows, the bindings (i.e. what we call “variables” in some other languages) brought into the scope by inner with statements actually take precedence over the ones from outer withs – the oposite of explicit bindings.
But I would still recommend against nesting with statements, since doing so can lead to further confusing behaviours. For example,with pkgs; [ ... ] ++ (with python3Packages; [ pkg-config ]) will actually bring in pkgs.pkg-config instead of the expected pkgs.python3Packages.pkgconfig when one accidentally include a dash in the package name.