If the Prayer has an effect in the real world then neither of these thing remove it from scientific investigation.
It most certainly does! Prayer is not some incantation, repeatable under controlled conditions. It is
God who affects our physical realm, sometimes / partially through prayer. We have Scripture re: righteous men who could not pray for a certain thing requested of them. Why? There is a
relationship here.
Again, the fact that it is of Spiritual nature removes it from scientific study, although organized thinking skills (such as gained via scientific pursuit) can certainly be applied to Spiritual efforts, making them more rewarding.
Unless it is God's will that man should be counfounded and unable to ascertain the power of prayer to affect things in reality.
Under what conditions? And in what sort of relationship?
(Isa 59:2) But your iniquities have separated between you and your God, and your sins have hid [his] face from you, that he will not hear."
The Good News is that no one needs to remain in said condition. (But fixing this does not automatically grant a working understanding of prayer)
The "trouble" really then is for any claims that prayer is effective in the real world.
Only if a Christian were trying to prove something via scientific means. Which is no problem at all, since Faith is a different pursuit
So, as an alternative to Sandwiches' first question I will pose this:
If a follower of Hinduism were to make the same claim about prayer to some Hindu god, would it convince you of the power of prayer to Ganesh?
And consistent with my reply to sandwiches, I am not at all convinced that their God is any different entity at all. How many Names does the Biblical God have? I certainly can't count, and I don't know anyone who has been able to. Why would He not reveal Himself to them according to their ability to receive, just as He has done with everyone else?
OTOH, there ARE unholy spirits in this world, and there are times when they will both be involved in religion, and answer prayer. I do believe we will see an increase of that sort of thing in our lifetime, but I do not know enough about Hinduism to speak to any specific point on this plane.
I personally give people the benefit of the doubt for various reasons, one of which is I have known sincere people whom God blesses from every walk of life and belief system I have encountered. And vice versa! There are insincere people of every profession of Faith who totally violate God's precepts, including the ones they know of. So in summary, what you're asking here really is not any dividing line, although I admit it does seem like it should be.