For a PhD application: assuming a student has a good technical GPA (whatever that means from your point of view) and took some challenging technical classes and some grad courses; what would you think if he has taking some "challenging" courses for unrelated topics on Pass/Not Pass basis. My university lets me take one third of my whole units for P/NP basis. For example, as a math major, what if instead of taking easy humanity courses, I take hard humanity courses; but not for letter grade. How would this affect a grad school application?
I have been to Ph.D. admissions committees both as a grad student and as a faculty member. Generally speaking, if those courses are not very relevant to your major and your intended area of research, I wouldn't pay much attention to "Pass" grades (whereas low letter grades would probably stand out) We get plenty of domestic and foreign applicants with very diverse backgrounds and there are much more important things to look at in their application package.
I assume that the genesis of your position is that you want to be challenged in class, but not at the expense of risking a bad grade staining your otherwise impressive transcript in a subject that probably won't define your career. While this is certainly not the only approach, it seems sound thinking to me.
If they do affect your GPA in a negative way, however, I would consider a bit more carefully--perhaps not in a binary way, but in regards to how many courses to do this with.
By the way, remember that as a Ph.D. student you can also take courses outside your major you feel curious about. I certainly did that.
Short answer, yes it could affect your grad school application. If the school is looking at those non-major classes.
What you should do is check with the admissions councilors at the schools you are interested in. Each school may look at this differently, but be prepared to give an explanation as to why you took those classes, in case they ask.
The best way that you can do this is in your personal statement or any other essays that might be included in your application. Within that paper, I suggest that you talk about the areas of study that you wish to grow your knowledge, even if it is a "basic class". If you word it right, you can show how you enjoy learning new and challenging topics, which is why you chose to take certain classes at a harder, but pass/fail, level even though they did not apply to your major.
Edit: I only suggest that you add this into your statement if the councilors state that those classes will be taken into consideration. If they deem otherwise, then there is no need to worry about those classes.