Maybe I'm misunderstanding you, but it looks like it
is a PHP specific problem. Python does not have it.
Of course at C level parameterised queries ("prepared statements") do not accept arrays. It would not make sense for them to do.
This is because the placeholders can be substituted by values of different types.
In typed programming languages, arrays have elements of the same type.
For example in SQLite, you are supposed to call `sqlite3_bind_int()`, `sqlite3_bind_text()` [1], once for each query parameter.
In languages like PHP and Python, where arrays can carry values of different types, their wrappers around the SQLite C functions can do this function calling for each value in the array. In Python, that is easy, the default, and explained in the very beginning of the official standard library's sqlite documentation [2]:
It states at the very beginning that query construction by string construction is unsafe and must be avoided. It immediately provides an example of how to safely call a parameterised query with an array of values, using `execute()` and `executemany()`.
PHP's standard library simply does not seem to have such an `execute()` function that accepts an array [3], nor do the official docs seem to contain any prose that could explain how to use the library safely [4]. The only way you can find out is by reading user-contributed comments on some specific functions in the function reference.
So Python's standard library provides safe functions, and immediately instructs the user how to use them. PHP's does not. Unclear to me how one can conclude that this isn't a PHP specific problem.
[1]: https://www.sqlite.org/c3ref/bind_blob.html
[2]: https://docs.python.org/3/library/sqlite3.html
[3]: https://www.php.net/manual/en/sqlite3.prepare.php
[4]: https://www.php.net/manual/en/class.sqlite3.php