text: Title: SyntaxError occurs when dynamically modifying generator function source during runtime
  Body: ### Description
  
  When a spider callback function is modified at runtime (e.g., during development with auto-reloading tools), Scrapy's `warn_on_generator_with_return_value` check may fail due to a syntax error caused by inconsistent code parsing. This occurs because `inspect.getsource()` retrieves the updated source code, but line/indentation calculations may reference the original version, leading to incorrect code extraction and AST parsing failures.
  
  ### Steps to Reproduce
  
  1. Create a Scrapy spider with a generator-based callback (e.g., using `yield`).
  2. Run the spider.
  3. During runtime, modify the callback function in a way that changes line breaks or indentation (e.g., adding/removing parentheses across lines).
  4. Trigger a new request to the modified callback.
  
  **Expected behavior:** Scrapy should handle code changes gracefully or ignore runtime modifications.
  
  **Actual behavior:** A `SyntaxError` (e.g., `unmatched ')'`) is raised during AST parsing due to mismatched code extraction.
  
  **Reproduces how often:** 100% when code modifications alter line structure during runtime inspection.
  
  ### Versions
  
  ```
  Scrapy       : 2.12.0
  Python       : 3.13.2 
  Platform     : Windows-11
  ```
  
  ### Additional context
  
  **Root Cause**:  
  The `is_generator_with_return_value()` function in `scrapy/utils/misc.py` uses `inspect.getsource()` to retrieve the current source code of a callback. If the function is modified during runtime (especially changes affecting line breaks/indentation), the parsed code snippet may be truncated incorrectly, causing AST failures.
  
  **Minimal Reproduction (Non-Scrapy)**:  
  Run this script and modify the `target()` function during execution:
  ```python
  from inspect import getsource
  import time
  
  def target():
      # Edit this function during runtime
      yield 1
  
  while True:
      try:
          src = getsource(target)
          ast.parse(src)
      except Exception as e:
          print(f"Failed: {e}")
      time.sleep(1)
  ```
  
  **Affected Code**:  
  The issue originates from [`scrapy/utils/misc.py` L245-L279](https://github.com/scrapy/scrapy/blob/master/scrapy/utils/misc.py#L245-L279), where dynamic source retrieval interacts poorly with runtime code changes. While `inspect.getsource()` works as designed, Scrapy's logic doesn't account for source mutations after spider initialization.
  
  **Suggested Fixes**:  
  1. Cache the initial function source code during spider setup.
  2. Add an option to disable generator return checks.
  3. Implement robust error handling around AST parsing.