Here is an interesting śloka from Dattātreya-yoga-śāstra:
ब्राह्मणः श्रमणो वा बौद्धो वाप्यार्हतोऽथवा।
कापालिको वा चार्वाकः श्रद्धया सहितः सुधीः।
योगाभ्यासोऽतो नित्यं सर्वसिद्धिमवाप्नुयात्॥३८॥
brāhmaṇaḥ śramaṇo vā bauddho vāpyārhato’thavā |
kāpāliko vā cārvākaḥ śraddhayā sahitaḥ sudhīḥ |
yogābhyāso’to nityaṁ sarvasiddhimavāpnuyāt || 38 ||
Whether he is brāhmaṇa, śramaṇa (ascetic) or follower of Buddhism, jain, kāpālika or (even) cārvāka (materialist). If he is constantly practicing yoga with full faith, he will obtain all siddhis.
It is interesting that even cārvākas are mentioned, although I referred to such an opportunity many years ago, that aroused bewilderment in many. My opinion is very simple, the yogic worldview is plain, therefore it is flexible: if you like the doctrine with a complex metaphysics and theological concept – you can follow it, if you like a simple one – the same. I got my first mystical experience when I was living in an atheistic country, I did not have any books about the Śhiva’s omnipresence. You can call it anything, but there is something higher that regulates everything. And through what we discover it for ourselves, would it be sincere faith in God or sincere atheism, no one knows. Ideologies can sometimes serve as tools for understanding the yogic experience, that lies behind their formal images.