Am I right to assume the latter probably is more secure?
This is the wrong question. First of all, there's no linear scale of security. There are approaches that are more robust to certain classes of errors. But an approach can be less vulnerable to one kind of attack and more vulnerable to another. That's why it's important to have some idea of your threat model.
Given that we don't know anything about the context of how the code would used it's impossible to say.
Consider a scenario, such as in a drag-and-drop interface where a type B ends up being passed into a function designed to work with type A. In Python that might 'work' and do something unexpected (perhaps completely benign) or it might fail because the type supplied doesn't support the necessary methods. In the alternate strong-typing path, let's assume a cast fails. All of these could represent security vulnerabilities and there's no way to say which is worse, in general.
The only thing I would say is that the scenario where passing the wrong type 'works' might present more interesting types of vulnerabilities than an exception/fault. The Log4Script vulnerability comes to mind. Generally speaking, it's better to crash than do something unknown and strong-typing can facilitate crashes. Strong-typing can also help protect against other programming errors. But it is not a panacea and thinking that it's better in general is wrong.
Is the former a good place to discover vectors of attack?
Perhaps but I would think it's better to take it up one level and look for ways you might end up with the wrong type of thing being passed into a method and how you can prevent that.