The Greek word translated "religion," as found in the letter of James, means "worship or adherence that is outwardly evident."
James 1:27 says, "Pure and undefiled religion in the sight of our God and Father is this: to visit orphans and widows in their distress, and to keep oneself unstained by the world." Visiting people is an outward thing. A stain is something someone can see. To be unstained means people don't see "the world's" stains on you.
The same Greek word is also used in Acts 26:5, "I lived as a Pharisee, the strictest sect of our religion."
The word religion, as used in the Bible, is an outward identification. You look and act like a Jew if you are Jewish. You act like a Christian, love others and exhibit good character, if you are a Christian. That very thing of showing others that you belong to Jesus is what James writes about in his letter when talking about faith and works.
So in the first century "religion" was something you showed not something you told. Jews looked and dressed a certain way. They could be seen observing Old Testament ceremonies and rituals. James was saying Christians are identified by love, compassion, and character; the real meat of life rather than the lifeless soggy bread of rituals.
Jesus said, "All men will know that you are my disciples, if you love one another." (John 13:35)
Religion is a neutral word both in the Bible and in today's English. It, like most words in scripture, is a regular word defined by context.